Introduction to the Logical Structure of XML Documents Web Engineering, SS 2007 Tomáš Pitner, Michael Derntl
Example of an XML Document Alfred Gusenbauer SPÖ Wilhelm Molterer ÖVP
Alfred Gusenbauer SPÖ Wilhelm Molterer ÖVP XML Document – Prolog/Heading XML Prolog Version: typically 1.0 Character encoding: UTF- 8, UTF-16, US- ASCII always work!
XML Document - Root Element Alfred Gusenbauer SPÖ Wilhelm Molterer ÖVP Root element contains most of the information in the doc, every doc must have exactly one root element!
Alfred Gusenbauer SPÖ Wilhelm Molterer ÖVP Elements and Tags End Tag of the element Start Tag of the element Element Element Name
Attributes Alfred Gusenbauer SPÖ Wilhelm Molterer ÖVP Attribute Name: unique within an element! Attribute Value: in single or double quotes! Attribute: placed in the element's start tag Note: multiple Attributes are separated through whitespace
Alfred Gusenbauer SPÖ Wilhelm Molterer ÖVP Element Content: Text Nodes Element Content: Text Node Element
Alfred Gusenbauer SPÖ Wilhelm Molterer ÖVP Element Content: Child Elements (Parent) Element
Alfred Gusenbauer SPÖ Wilhelm Molterer ÖVP XML Document with DTD Document Type Declaration Root element name System identifier (URI) of the entity/file with Document Type Definition
XML Document with Comment Alfred Gusenbauer SPÖ Wilhelm Molterer ÖVP Comment (-node): usually not interpreted by the application Comment content
Alfred Gusenbauer SPÖ Wilhelm Molterer ÖVP Processing Instructions Processing Instruction: interpretation depends on application PI Target PI Data (no attributes!)