Saturday, April 10, 2010

Project #2 Extra Credit: DOM API

For the extra credit problem in project #2, you MUST use the Apache Xerces2 library. The pages of interest are:

Home Page: http://xerces.apache.org/xerces2-j/
Java Docs: http://xerces.apache.org/xerces2-j/javadocs/api/
Download: http://archive.apache.org/dist/xml/xerces-j/

Make sure you download the 2.9.0 binary version of Xerces2 for Java: Xerces-J-bin.2.9.0.zip (or tar.gz). The library comes with a samples folder containing a number of examples for using DOM. I strongly suggest that you look at the code under both samples/dom and samples/ui. The distribution also includes a copy of the java docs.

I'm also linking to an example showing you how to traverse and print a DOM tree:

http://idevelopment.info/data/Programming/java/xml/XercesXmlDomExample.java

If you want to use the original DatabaseInventory.xml file, you can download it from here:

http://www.idevelopment.info/data/Programming/java/xml/ExampleXMLandDTDFile.html

No comments:

Post a Comment