Can you think of other ways to use the JAXP parser created in this article? How might you make use of JAXP's flexibility in your organization? Tell us in the java.general discussion group.
By writing to the JAXP specification, Java developers can create extensible code routines to parse any type of data into XML. This tutorial shows you how to write your own JAXP-compliant parser to transform legacy data in a comma-separated value (CSV) format, output it to a DOM, and then transform into XML.
by Matt Liotta
April 8, 2002
he ability to parse and transform XML documents is nothing new for Java developers. There are several packages available that come with the tools to do it. But these products all have incompatible implementations, so once you start using one package, you're locked in.
Sun Microsystems has attacked this problem by creating interfaces for many different aspects of XML programming. One of the packaged interfaces Sun created is the Java API for XML Processing (JAXP), which is part of its early release XML pack. JAXP abstracts both XML parsing and transformations. Thus, writing your XML processing code using JAXP will make it portable to any other implementation that supports JAXP. As of this writing, the XML pack comes with Xerces2, XalanJ, and Crimson, which all support JAXP. Many people consider Apache's Xerces2 and XalanJ to be the de facto standards for Java XML processing anyway, so their support for JAXP is no surprise.
It's quick, easy and you get access to all the articles on DevX.
This registration/login is to allow you to read articles on devx.com. Already a member?
To become a member of DevX.com create your Member Profile by completing the form below. Membership is free!