Tuesday, January 17, 2006

Deciphering XML in Day One

SAX – Simple API for XML processing, it is based on event-model.
DOM – based on object model.

JAXP – Java API for XML Processing

SAX and DOM are two different parsing APIs most widely used. Other parsing APIs are JDOM, dom4j etc. JAXP is a set of APIs that’s designed on top of SAX, DOM and other parsing APIs, and acts as a layer of abstraction to handle some (parser) vendor-specific tasks in a vendor-neutral way. JAXP provides a means of getting to these parsers and the data that they expose, but doesn't offer a new way to parse an XML document.
Most popular XML parsers will be supported through JAXP. When it is installed and supporting a particular parser, JAXP can be used to select it. The main value of JAXP is to act as the adaptor between the JAXP API and the vendor specific parsers.
With JDK 1.4, Sun has included JAXP in the standard distribution of the JDK, and therefore is available out of the box. Even more, JDK 1.4+ comes with Apache’s Crimson XML parser, so you don’t have to worry about that either.

Some JAXP pointers
http://java.sun.com/xml/downloads/jaxp.html - Specification
http://java.sun.com/webservices/docs/1.6/api/index.html - JAVADOC API
http://www-128.ibm.com/developerworks/xml/library/x-jaxp/
http://www.devarticles.com/c/a/XML/Java-and-XML-Basics-1/
http://www.devarticles.com/c/a/XML/Java-and-XML-Basics-2/
http://www.devarticles.com/c/a/XML/Java-and-XML-Basics-3/

JDOM
JDOM is a set of API based on the DOM model, it uses “new” operator to initiate parsers rather than using the factory pattern which are considered complicated by many. Both SAX and DOM parsers can be plugged in. SAXBuilder listens for the SAX events and builds a corresponding Document in memory. That approach is very fast (basically as fast as SAX), and it is the approach we recommend. It provides API more intuitive to the Java programmers to traverse the XML tree. JDOM uses the JAXP to select parsers.

Some JDOM pointers
http://www.javaworld.com/javaworld/jw-05-2000/jw-0518-jdom.html
http://www-128.ibm.com/developerworks/java/library/j-jdom/index.html
http://www.oracle.com/technology/oramag/oracle/02-sep/o52jdom.html
http://www.oracle.com/technology/oramag/oracle/02-nov/o62odev_jdom.html

DOM4J

DOM,SAX,JDOM,JAXP的关系
http://searchwebservices.techtarget.com.cn/askexperts/139/2229139.shtml?ticket=ST-10519-EEGFnBSpDJQhMWMu4uA9

Jakarta Common Digester
http://www.javaworld.com/javaworld/jw-10-2002/jw-1025-opensourceprofile.html
http://www-128.ibm.com/developerworks/java/library/j-lucene/

http://www.devx.com/Java/Article/21832/0/page/1

XML in general
http://www.informit.com/guides/guide.asp?g=xml

0 Comments:

Post a Comment

<< Home