• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Please demystify JAXP

 
Ranch Hand
Posts: 782
Python Chrome Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have been using Xerces-J for close to 3 months and am confused on how to use JAXP with it without running into CLASSPATH problems. Can someone provide a definitive overview on what parsers support JAXP, the correct versions 1.0 vs 1.1 and the exact configuration for the environ to work?
I intend to port all my xml & xslt processing code to JAXP.
Thanks
Pho
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Pho,
I don't have time right now to code an example for
you but JAXP is very simple and already integrated into
Xerces so I don't think you will have any problem
converting your code to use JAXP.
JAXP is simply a pluggability API that allows you to
use the SAX or DOM parser of your choice that have
implemented subclasses of javax.xml.parsers.DocumentBuilderFactory
and javax.xml.parsers.SaxParserFactory.
Which parser is actually used depends on the value of
the Java System properties:
javax.xml.parsers.DocumentBuilderFactory
and
javax.xml.parsers.SAXParserFactory.
The value of these properties need to be a subclass to
instantiate. For example, Xerces reimplemented the
abstract classes in javax.xml.parsers (and includes them
in their distribution, so if you have the xerces jar in
your classpath you are set).
Here is what Xerces sets the value of the
Document Builder Factory to:
private static String factory=
"org.apache.xerces.jaxp.DocumentBuilderFactoryImpl";
You can set these properties in one of two ways:
System.setProperty(key, value); // check out the docs
or the
-D option when invoking java
Hope this helps,
- Mike

 
Pho Tek
Ranch Hand
Posts: 782
Python Chrome Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've seen a lot of software packaged with these files:
- jaxp.jar
- parser.jar
Is there a way to probe the jars to find out the exact
versions of JAXP that's supported here other than
listing the contents of the jars ?
Cheers
Pho
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!