MSc Revision Notes - XML
Exam topics
Main topics
- XML overview
- DTDs
- Schema
- XPath
- XSL
Notes
- XML syntax rules:
- Case sensitive
- Element/attribute names beginning with 'xml' are reserved.
- Root element is required
- End tags are required
- Elements must be properly nested
- Attribute values must be enclosed in quotes
- Entity references must be declared
If a document observes the syntax rules of XML it is well-formed
A valid document is well formed and has been validated against a DTD.
- 5 built-in entities:
& (&) < (<) > (>) " (") ' (') Everything inside a CDATA section is ignored by the parser. <![CDATA[this is not parsed]]>
Elements vs attributes
- Elements
- Elements may be nested.
- Order is always present
- Attributes
- Attributes can only be simple values
- No ordering implied
- Name cannot repeat
- Tend to be used to provide more information about an element
- Special features when used with DTDs
DTDs
- DTDs define the XML document structure with a list of legal elements.
