1 / 10

An Introduction to XML

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 data document that can be read by a person using a text editor. What does XML do better?.

kmccormick
Download Presentation

An Introduction to XML

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  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 <sales> <company>Apple</company> <numberofIpods>300</numberofIpods> <state>IL</state> </sales>

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

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

  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 • <?xml version="1.0" encoding="UTF-8"?> <element> <element2>A</element2> <element3>B</element3> <element3>C</element3> </element> • <?xml version="1.0" encoding="UTF-8“?> <q d=‘a’ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation=“filename.xsd"> <z>1</z> <z>2</z> </q>

  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-introduction-xml • W3C Recommendation for XML definition 1.0 (third edition) http://www.w3.org/TR/REC-xml/ • XML from the Inside Out (O’Reilly) http://www.xml.com

More Related