up previous next contents
Next: XSLT Up: Survey of other server-side Previous: Survey of other server-side   Contents

XML

  • eXtensible Markup Language
  • Derived from SGML, which is also the original parent language of HTML.
  • XML is a "meta" language, that can be used to defined an unlimited number of custom hierarchical data formats.
  • Example:
      <?xml version="1.0" ?>
      <sandwich price="2.00">
        <meat>Pastrami</meat>
        <bread>Rye</bread>
        <cheese slices="1">Swiss</cheese>
        <condiments>
          <condiment>mustard</condiment>
          <condiment>pepper</condiment>
        </condiments>
      </sandwich>
    
  • In the example above <sandwich>, <condiment>, and all tags within <> are elements.
  • Elements can be nested within each other infinitely deep.
  • "price" and "slices" are attributes of their respective elements.
  • XML must be well formed to be porcessed:
    • All tags are closed: <bread>Rye</bread>,
      or <bread/> which denotes an empty element.
    • Elements must be closed on the same level they start.
      <sandwich><meat></sandwich></meat> is not well formed.
    • All attributes are within single or double quotes.
  • The structure of a particular XML document can be described with Document Type Definitions (DTD) or schemas. Instances of that document can then be validated against the corresponding DTD or schema.
  • Why use XML?
    • Flexible hierarchical data formatting language that can easily be read by humans as well as programs.
    • Readily available tools for document creation, parsing, and validation.
    • Plaform and programming language neutral.
  • The Java API for XML Processing (JAXP) defines a standard interface for using XML in Java programs. There are several implementations of this API, including Xerces from the Apache Group and Crimson from Sun.


up previous next contents
Next: XSLT Up: Survey of other server-side Previous: Survey of other server-side   Contents