DTD_Notes_-_updatesp1 - Introduction to XML Is a...

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

View Full Document Right Arrow Icon
1 Introduction to XML Is a Well-formed XML Document Valid? Is a Well-formed Document Valid? l An XML document is said to be well-formed if it follows all of the "rules" of XML, such as proper nesting and attribute use, so by definition all XML documents are well-formed. l A valid document, on the other hand, is one that is not only well-formed, but also follows the restrictions set out in a specific grammar, typically specified in a Document Type Definition (DTD) or some form of XML Schema. Is a Wellformed Document Valid? l An example of a document that is well-formed but not valid based upon the XHTML grammar. <body> <p> Example of Well-formed HTML </p> <head> <title> Example </title> </head> <zorko> What is this? </zorko> </body> Why? HTML vs. XML l In the case of HTML, browsers have been taught how to ignore invalid HTML such as the <zorko> element and generally do their best when dealing with badly placed HTML elements. l The XML processor, on the other hand, can not tell us which elements and attributes are valid. As a result we need to define the XML markup we are using. To do this, we need to define the markup language’s grammar. Introduction to XML Tools Used to Create XML Languages Tools of the Trade l There are numerous “tools” that can be used to build an XML language – some relatively simple, some much more complex. l They include: DTD (Document Type Definition) – RELAX – TREX RELAX NG XML Schema – Schmatron
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 DTD l The Document Type Definition, a direct descendant of SGML. l DTDs are what are used to describe HTML and XHTML in addition to other markup languages. l DTDs possess their own special notation – which is were we will start. RELAX l Written by Dr. Murata Makoto . l RELAX stands for Regular Language description for XML l It is a simpler notation for describing markup grammar than XML Schema. l Like XML-Schema, it is also XML-based. l Resources : v http://www.xml.gr.jp/relax/ v http://www.xml.gr.jp/relax/html4/howToRELAX_full_en.html TREX l Designed by James Clark . l TREX stands for Tree Regular Expressions for XML l TREX is a simple, concise notation. l Resources v http://www.thaiopensource.com/trex/ v http://www.thaiopensource.com/trex/tutorial.html RELAX NG l Created by James Clark and Dr. Murata Makoto . l RELAX NG stands for RELAX Next Generation . l RELAX NG is a convergence of the RELAX and TREX grammars. l Resources : v http://www.oasis-open.org/committees/relax-ng/spec- 20011203.html v http://www.oasis-open.org/committees/relax-ng/tutorial.html XML Schema l Developed by the W3C initiative. l It is an XML-based markup language used to describe grammar. l It is VERY complicated in comparison to other methods of describing grammar. Schmatron l Developed by Rick Jelliffe. l Allows you to define patterns rather than grammar like DTDs, Relax NG and XML Schema among others.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 18

DTD_Notes_-_updatesp1 - Introduction to XML Is a...

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

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