Docsity

XML & Distributed Software Dev: Parsing & Structuring at Univ. of San Francisco, Study notes of Software Engineering

Partial preview of the text

Download XML & Distributed Software Dev: Parsing & Structuring at Univ. of San Francisco and more Study notes Software Engineering in PDF only on Docsity!

Distributed Software Development

XML Chris Brooks

Department of Computer ScienceUniversity of San Francisco

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: