Characteristics of XML

  • Based on SGML, as is HTML
  • Can create your own elements (tags) and attributes
  • Specification is strict, so that machines can efficiently read and interpret XML

Related Specifications

  • Document Type Definition (DTD): specifying structure of XML documents
  • XML Schema: specifying structure of XML documents
  • Extensible Stylesheet Language – Transformation (XSLT): specifying the display of an XML document
  • XML Query: extracting and combining XML document components

Uses for XML

  • For displaying documents in multiple formats
  • For exchanging information between computers

Uses of XML Programming

  • Transforming XML documents on the server before delivering them to browsers.
  • Combining XML documents from various servers before delivering combined results to browsers.
  • Creating your own XML authoring and editing tools, for example, allowing authors to enter content using HTML forms.
  • Validating XML documents when document authors publish them to the server.
  • Using XML as a tool to assist in other programming tasks.

Using XSLT Instead of Programming

  • Supports selection and re-ordering of elements, counters, conditional statements, inserting additional content.

Tree-Traversal and Event-Driven Models

  • Tree traversal approaches reads entire document into a tree data structure and provides mechanisms for navigating through the tree an altering the tree.
    Standard: Document Object Model (DOM)
  • Event driven approaches scan the document, triggering events specified by the programmer.
    Standard: Simple API for XML (SAX)