XML.com: XML From the Inside Out
oreilly.comSafari Bookshelf.Conferences.

advertisement
 Resource Guide -> XML and Java Tutorials, SAX vs. DOM, IBM -> XML programming in Java

XML programming in Java

Date: May. 22, 2001
Link: http://www-105.ibm.com/developerworks/education.nsf/xml-onlinecourse-bytitle/090E4CED6DF2AA648525682
Source Author or Organization: Doug Tidwell, IBM developerWorks

This tutorial by IBM Senior Programmer and XML Evangelist Doug Tidwell introduces beginners to using an XML parser to process, manipulate and create XML documents. It also covers some advanced parser functions, but does not deal with transforming XML documents, using visual tools or creating interfaces for end users.

Before demonstrating how to use a parser, Tidwell discusses why you would want to use a parser, describing different kinds of parsers, including validating versus non-validating parsers, Simple Application Programming Interface for XML (SAX) versus Document Object Model (DOM) parsers and the pros and cons of parsers written in particular programming languages. The student downloads a sample XML application (marking up Shakespeare's Sonnet 130), and then repeats the instructor's Java coding steps to perform several typical DOM functions. The process is then repeated for SAX.

Now that the student has some hands on experience with both SAX and DOM, the features of each are contrasted in more detail. The tutorial ends with more advanced parser usage: building a DOM tree from scratch, using DOM methods to manipulate the tree, and an exercise that illustrates how standard interfaces like SAX and DOM make it easier to switch between parsers.

XML4J is required to follow the tutorial examples. A brief registration is required to enter the tutorial.