An%20Introduction%20to%20XML - PowerPoint PPT Presentation

About This Presentation
Title:

An%20Introduction%20to%20XML

Description:

An Introduction to XML Presented by Scott Nemec at the UniForum Chicago meeting on 7/25/2006 Definition(s) XML expands out to: eXtensible Markup Language A text based ... – PowerPoint PPT presentation

Number of Views:65
Avg rating:3.0/5.0
Slides: 11
Provided by: ScottN156
Category:

less

Transcript and Presenter's Notes

Title: An%20Introduction%20to%20XML


1
An Introduction to XML
  • Presented by Scott Nemec
  • at the UniForum Chicago meeting on 7/25/2006

2
Definition(s)
  • XML expands out to eXtensible Markup Language
  • A text based data document that can be read by a
    person using a text editor.

3
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.

4
Why use XML?
  • Much more defined context and human-readable than
    other text like comma-delimited
  • Apple, 300, IL
  • ltsalesgt
  • ltcompanygtApplelt/companygt
  • ltnumberofIpodsgt300lt/numberofIpodsgt
  • ltstategtILlt/stategt
  • lt/salesgt

5
What makes up an XML document?
  • 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.
    ltelementgtalt/elementgt, ltelement/gt)
  • Example with fruit element ltfruitgtapplelt/fruitgt
  • 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 ltfruit
    nameapple/gt
  • Optional header
  • Provides information about the document,
    including links to definitions to be used for the
    document

6
Well Formed?
  • Well Formed means the xml document doesnt have
    a syntax problem.
  • Every element has both an explicit start and an
    explicit or implicit end. That includes having
    matching lt and gt.
  • Attributes have a name, an and single quotes
    (ie ) enclosing the value.

7
Valid?
  • 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.

8
Simple Examples
  • lt?xml version"1.0" encoding"UTF-8"?gt
  • ltelementgt
  • ltelement2gtAlt/element2gt
  • ltelement3gtBlt/element3gt
  • ltelement3gtClt/element3gt
  • lt/elementgt
  • lt?xml version"1.0" encoding"UTF-8?gt
  • ltq da xmlnsxsi"http//www.w3.org/2001/XMLSch
    ema-instance" xsinoNamespaceSchemaLocationfilen
    ame.xsd"gt
  • ltzgt1lt/zgt
  • ltzgt2lt/zgt
  • lt/qgt

9
Advanced Topics
  • XSLT - Extensible Stylesheet Language
    Transformations
  • XPath - XML Path Language
  • XQuery - a language designed for processing XML
    data (ie XML databases)
  • I recommend http//www.xml.com as a step for
    learning more about XML .

10
References for further study
  • A Really, Really, Really Good Introduction to
    XML
  • By Tom Myer
  • http//www.sitepoint.com/article/really-good-intr
    oduction-xml
  • W3C Recommendation for XML definition 1.0 (third
    edition)
  • http//www.w3.org/TR/REC-xml/
  • XML from the Inside Out (OReilly)
  • http//www.xml.com
Write a Comment
User Comments (0)
About PowerShow.com