Download presentation
Presentation is loading. Please wait.
Published byFelicia McCarthy Modified over 9 years ago
1
XML D EMYSTIFIED 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
W HAT T HE !? Extensible Markup Language A nested tree structure of elements Allows users to define their own elements Designed for carrying data
4
S IGNIFICANCE 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
A RE Y OU F OR S ERIOUS ? 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 B RIEF H ISTORY 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
S TRUCTURE 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 contains text or other tags Every opening must contain a closing Tags can have any name
8
E XAMPLE
9
E XAMPLE … Root Element Attribute Value
10
V ALIDATION 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
XP ATH A method of traversing an XML document Useful for retrieving attributes and values of tags
12
DTD
13
D ISPLAY 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
R ESOURCES 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
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.