xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Simon McClenahan" <simon.mcclena...@stellent.com>
Subject RE: Crimson questions
Date Mon, 11 Feb 2002 17:38:58 GMT

> -----Original Message-----
> From: Edwin Goei [mailto:edwingo@sun.com]
> Sent: Monday, February 11, 2002 11:08 AM
> To: general@xml.apache.org
> Subject: Re: Crimson questions
> Simon McClenahan wrote:
> > 
> > I can create a serialization utility class for each parser, but only
> > distribute the one parser that is suitable, right?
> Not sure what you mean.

I can create and distribute CrimsonUtils.class and XercesUtils.class .
At run-time I determine which implementation is being used. From
javax.xml.parsers.DocumentBuilderFactory#newInstance() and your JAXP

Q. How do I use a different JAXP compatible implementation? 

The JAXP 1.1 API allows applications to plug in different JAXP
compatible implementations of parsers or XSLT processors. For example,
when an application wants to create a new JAXP DocumentBuilderFactory
instance, it calls the staic method
DocumentBuilderFactory.newInstance(). This causes a search for the name
of a concrete subclass of DocumentBuilderFactory using the following

- The value of a system property like
javax.xml.parsers.DocumentBuilderFactory if it exists and is accessible.

- The contents of the file $JAVA_HOME/jre/lib/jaxp.properties if it
- The Jar Service Provider mechanism specified in the Jar File
Specification. A jar file can have a resource (i.e. an embedded file)
such as META-INF/javax/xml/parsers/DocumentBuilderFactory containing the
name of the concrete class to instantiate. 
- The fallback platform default implementation. 

Of the above ways to specify an implementation, perhaps the most useful
is the jar service provider mechanism. To use this mechanism, place the
implementation jar file on your classpath. For example, to use Xerces
1.4.4 instead of the version of Crimson which is bundled with JDK 1.4
(Java Development Kit version 1.4), place xerces.jar in your classpath.
This mechanism also works with older versions of the JDK which do not
bundle JAXP. If you are using JDK 1.4 and above, see the following
question for potential problems.

The Crimson jar has
META-INF/services/javax.xml.parsers.DocumentBuilderFactory file, as
specified in the javax.xml.parsers.DocumentBuilderFactory#newInstance()
JavaDoc. Is this different than the Jar Service Provider example given
above in the JAXP FAQ?

> > The only other parser is Aelfred which does not support DOM. What do
> > applet developers use for XML parsing? Obviously not JAXP/DOM !
> You could also try using dom4j or jdom.

I'm trying to stick with Java standards, and JAXP does not support dom4j
or jdom, does it? I thought JAXP only provides for SAX and W3C DOM.


In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
For additional commands, e-mail: general-help@xml.apache.org

View raw message