This preview shows pages 1–3. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: . . Fall 2007 CS560: XML Data Management Alexander Dekhtyar . . XML in a Nutshell Note In these notes we abridge the XML Recommendation and extract from it the most important parts. XML Requirements The following high-level non-functional requirement have been specified for XML by the XML Working Group at W3C. 1. XML shall be straightforwardly usable over the Internet. 2. XML shall support a wide variety of applications. 3. XML shall be compatible with SGML. 4. It shall be easy to write programs which process XML documents. 5. The number of optional features in XML is to be kept to the absolute minimum, ideally zero. 6. XML documents should be human-legible and reasonably clear. 7. The XML design should be prepared quickly. 8. The design of XML shall be formal and concise. 9. XML documents shall be easy to create. 10. Terseness in XML markup is of minimal importance. 1 Well-Formed XML Documents XML Recommendation specifies (in Backus-Naur form) the grammar for construction of an XML document. In addition, it provides some extra constraints that must be satisfied by well-formed and valid XML documents. document ::= prolog element Misc* prolog ::= XMLDecl Misc* (doctypedecl Misc*)? XMLDecl ::= &lt;?xml VersionInfo EncodingDecl? SDecl? S? ?&gt; VersionInfo ::= S version S? = S? (1.1|1.0|1.1&quot;,|1.0&quot;) element ::= EmptyElemTag| STag content ETag Stag ::= &lt; Name (S Attribute)* S? &gt; Etag ::= &lt;/ Name S? /&gt; EmptyElemTag::= &lt; Name (S Attribute)* S? /&gt; Attribute ::= Name S? = S? AttValue content ::= CharData? ((element|Reference|CDSect|PI|Comment) CharData?)* Misc ::= Comment | PI | S PI = processing instruction S = whitespace Comment = comment doctypedecl = XML DTD description/reference Char = Unicode character data RestrictedChar = restricted character data (?) EncodingDecl = declaration of an encoding SDecl = standalone document declaration Name = allowable XML name - consists of allowable XML name charac- ters AttValue = XML attribute values CDSect = section of unparsed character data Notes An XML document consists of a prolog and one XML element , called the root element. The root does not appear in the content of any other element....
View Full Document