1 / 19

XML Demystified

XML Demystified. Presented By Carl-Erik Svensson. Announcements. Assignment 1.2 is due Wednesday 2/11/09 at 8am Name your SVN check-in mp1.2 csil-projects.cs.uiuc.edu/svn/sp09/cs242/netid/mp1.2 Make sure you are attending discussion Make sure you are using SVN

lane
Télécharger la présentation

XML Demystified

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. XML Demystified Presented By Carl-Erik Svensson

  2. Announcements Assignment 1.2 is due Wednesday 2/11/09 at 8am Name your SVN check-in mp1.2 csil-projects.cs.uiuc.edu/svn/sp09/cs242/netid/mp1.2 Make sure you are attending discussion Make sure you are using SVN Assignment 1.3 is due Wednesday 2/18/09 at 8am My office hours on 2/16/09 will be cancelled

  3. What The!? • Extensible Markup Language • A nested tree structure of elements • Allows users to define their own elements • Designed for carrying data

  4. Significance • Creates an open standard for sharing data • Simple, and easy to read both by people and machines • Foundation for many Internet languages • Separates content from presentation • Widely adopted • Microsoft, IBM, Sun, SAP, Mozilla, …

  5. Are You For Serious? • Here’s a list of technologies/products that use XML • Open XML (ala .docx files and Office 2007) • Google Earth (KML) • Finale Notepad (MusicXML) • Scalar Vector Graphics (SVG) • The Internet (HTML) • Really Simple Syndication Feeds (RSS) • Apache ANT

  6. A Brief History • Evolved from SGML (1986), inspired by Charles Goldfarb (and co.) at IBM in 1970 • Resulted in HTML • Standards were loosened • Data and display became intertwined (bad!) • Adopted by Microsoft, Sun, and IBM • Useful for interoperability • Owned by W3C

  7. Structure • XML has a tree structure • Contains a root element • Beneath the root are additional elements • Each element can have various attributes • It is implemented with tags • <aTag> contains text or other tags • Every opening <tag> must contain a closing </tag> • Tags can have any name

  8. Example

  9. Example… Root Element Attribute Value

  10. Validation • We want to share our data with the world • The world needs to know what our data looks like • We can define our data with a schema • XML Data can then be validated automatically • XSD • DTD

  11. XPath • A method of traversing an XML document • Useful for retrieving attributes and values of tags

  12. DTD

  13. Display • We have data, now what? • This data can be parsed by any number of programs • Data generated by web scraping • Kernel files consumed by image convolution • DEM to BMP converters/manipulators • We can also display the data directly • CSS • XSL(T)

  14. CSS

  15. XSLT • A method of defining a transformation from XML to something else • Usually HTML • Contains complex structure • Can define rules for each tag • Typically these rules describe how to render a tag • Utilizes XPath expressions

  16. Assignment 1.3 Use an XML file to define operations This will require parsing an XML file Luckily, there are some parsers we can use Call operations defined in the XML file Now we can define any combinations of basic operations as a single operation This makes our application externally programmable Due Wednesday, Feb 18th at 8am in SVN

  17. Assignment 1.3 - Sample XML Root is Operations Operations contains multiple ComplexOps Each ComplexOp is named and contains multiple Ops Each Op is named and contains parameters

  18. Assignment 1.3 - DTD

  19. Resources • http://www.w3schools.com/xml/default.asp • http://www.itwriting.com/xmlintro.php • http://www.w3schools.com/xpath/default.asp • http://www.w3schools.com/DTD/ • http://www.grinninglizard.com/tinyxml/ • http://ezxml.sourceforge.net/ • http://agora.cs.illinois.edu/display/cs242sp09/Assignment+1.3

More Related