q - K315 DTD Document Type Definition Click to edit Master...

Info iconThis preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon
Click to edit Master subtitle style K315 – DTD ‘Document Type Definition’ January 21, 2010
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Overview n What are valid documents? ¡ Definition ¡ Examples n DTDs ¡ Internal ¡ External n Checking the validity of an XML document against a DTD
Background image of page 2
Valid documents n Applications/documents developed by different sources must have common elements for accurate communication. n Consider our exercise from the last class. ¡ You combined all of the information from the 17 files into one well-formed XML document with elements for each of the students. n Was the resulting document well-formed? n What problems did you see with the data?
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Valid documents ¡ Well formed n No such thing as valid and not well formed ¡ Data complies with structural/content rules in: n DTD (or) n XML Schema Most existing (mainly just structure rules) Newer. More powerful. (structure + content)
Background image of page 4
DTD n “Document type definition” n Defines a set of rules that describe structure & permissible content of the XML data n If data in the XML document follows the DTD defined structure/content (& is well- formed)… ¡ Then the XML Document is VALID
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Document Type Definition n When a DTD is used, the XML document is checked to see if: ¡ All required elements are present. ¡ No undefined elements have been added. ¡ The hierarchical structure of the elements is maintained. ¡ All attributes are checked for compliance with guidelines.
Background image of page 6
Checking Validity n In other words, does the actual XML document match the structure defined by the DTD? Every last detail is checked. n Not automatic in IE n Validity checker… ¡ http://www.xmlvalidation.com/
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
EXAMPLE Last year. .. Amazon told us (their supplier) that their XML document looks like this: We want to filter/sort Amazon’s XML document and put results into an XML doc w/ the following format: <?xml version=“1.0”?> <!– Filename: Inventory.xml --> <INVENTORY> <BOOK> <TITLE>. ..</TITLE> <AUTHOR>. ..</AUTHOR> <BINDING>. ..</BINDING> <QUANTITY>. ..</QUANTITY> <PRICE>. ...</PRICE> </BOOK> ... </INVENTORY> <?xml version=“1.0”?> <!– Filename: Order.xml --> <ORDER> <LINEITEM> <TITLE>. ..</TITLE> <BINDING>. ..</BINDING> <QTY>. ..</QTY> </LINEITEM> <LINEITEM> ... </ORDER>
Background image of page 8
EXAMPLE Last year. .. Amazon told us (their supplier) that their XML document looks like this: We want to filter/sort Amazon’s XML document and put results into an XML doc w/ the following format: <?xml version=“1.0”?> <!– Filename: Inventory.xml --> <INVENTORY> <BOOK> <TITLE>. ..</TITLE> <AUTHOR>. ..</AUTHOR> <BINDING>. ..</BINDING> <QUANTITY>. ..</QUANTITY> <PRICE>. ...</PRICE> </BOOK> ... </INVENTORY> <?xml version=“1.0”?> <!– Filename: Order.xml --> <ORDER> <LINEITEM> <TITLE>. ..</TITLE> <BINDING>. ..</BINDING> <QTY>. ..</QTY> </LINEITEM> <LINEITEM> ... </ORDER> But what if Amazon’s working XML doc structure has changed since last year?
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 10
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/19/2011 for the course BUS 256 taught by Professor Several during the Fall '09 term at Indiana.

Page1 / 35

q - K315 DTD Document Type Definition Click to edit Master...

This preview shows document pages 1 - 10. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online