An Introduction to XML by ewghwehws


									An Introduction to XML

           Presented by Scott Nemec
at the UniForum Chicago meeting on 7/25/2006
• XML expands out to: eXtensible Markup
• A text based data document that can be
  read by a person using a text editor.
   What does XML do better?
• XML fits between SGML (Standard Generalized
  Markup Language) and HTML (HyperText
  Markup Language)
  – SGML – very generalized markup language that is too
    complex for general usage
  – HTML – a markup language for display purposes that
    is not meant to have its definition modified.
  – XML is meant to let people define how its elements
    and attributes combine for each purpose it is used for.
           Why use XML?
• Much more defined context and human-
  readable than other text like comma-
         Apple, 300, IL

           What makes up an XML
• Elements
   – has a name, and contains a text value or another element(s)
   – An element can have more than one instance in a document
   – the element must show it being closed after the element value, if there
     is any value (ie. <element>a</element>, <element/>)
   – Example with fruit element: <fruit>apple</fruit>
• Attributes
   – has a name, contains a text value, and is contained within an element.
   – it can only have one value per element instance in enclosing quotes
   – Example with ‘name’ attribute: <fruit name=‘apple’/>
• Optional header
   – Provides information about the document, including links to definitions
     to be used for the document
             Well Formed?
• ‘Well Formed’ means the xml document
  doesn’t have a syntax problem.
  – Every element has both an explicit start and
    an explicit or implicit end. That includes
    having matching ‘<‘ and ‘>’.
  – Attributes have a name, an ‘=‘ and single
    quotes (ie ‘ ) enclosing the value.
• ‘Valid’ means the content of the format of the
  XML document matches a definition (either a
  schema or DTD) of what the content should be
  for the document.
  – An XML schema is the more modern definition which
    includes much more detail in what is can be defined.
    A schema file is defined as an XML document itself.
  – An XML DTD is the older definition specification. A
    DTD document is NOT defined as XML.
               Simple Examples
• <?xml version="1.0" encoding="UTF-8"?>

• <?xml version="1.0" encoding="UTF-8“?>
  <q d=‘a’ xmlns:xsi=""
         Advanced Topics

• XSLT - Extensible Stylesheet Language
• XPath - XML Path Language
• XQuery - a language designed for
  processing XML data (ie XML databases)

I recommend as a step
   for learning more about XML .
    References for further study
• “A Really, Really, Really Good Introduction to XML”
  By Tom Myer
• W3C Recommendation for XML definition 1.0 (third edition)
• XML from the Inside Out (O’Reilly)

To top