

































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


































Department of Computer Science — University of San Francisco – p. 1/
Outline
-^ About XML •^ Structuring XML documents •^ Using CSS to display XML •^ Parsing with DOM •^ Parsing with SAX
Department of Computer Science — University of San Francisco – p. 2/
Advantages of XML
-^ Well-defined, easy-to-manipulate structure •^ Human-readable •^ Extensible •^ Metadata can be included directly with data •^ Widely used
Department of Computer Science — University of San Francisco – p. 4/
Things to note
-^ An XML document has two components: -^ tags (metadata) •^ content (data) -^ Metadata serves to help an application make senseof the data.
Department of Computer Science — University of San Francisco – p. 5/
XML documents as trees
-^ An XML document can also be represented as a tree. •^ This makes XML very easy to parse. •^ The outermost element is the root element, andelements contained within it are children of thatelement. •^ Content is stored at the leaves •^ What would the tree for our Tolkien example look like?
Department of Computer Science — University of San Francisco – p. 7/
Outline
-^ About XML •^ Stucturing XML documents •^ Using CSS to display XML •^ Parsing with DOM •^ Parsing with SAX
Department of Computer Science — University of San Francisco – p. 8/
Tags and elements
-^ Tags form the boundaries of elements, and giveprocessing instructions to parsers. -^ Empty elements:
<coAuthor
/>
All information is
contained in the tag. • Container elements:
-^ Comments: