xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Edwin Goei <edwi...@sun.com>
Subject Re: javax.xml.parsers.DocumentBuilderFactory
Date Sat, 13 Oct 2001 00:31:23 GMT
Isaac Shabtay wrote:
> 
> > Huh? I'm not sure what you mean.  The JAXP specification is effectively
> > a bunch of interfaces that anyone can implement (along with the rest of
> > the docs, etc.).  Apache happens to have several implementations of
> 
> Well, this I already know.
> Yet, javax.xml.parsers.DocumentBuilderFactory and
> javax.xml.transform.TransformerFactory are both *classes*, not *interfaces*.
> Lets discuss DocumentBuilderFactory: the "newInstance" method is responsible
> to get the factory, by searching four places:
> 
> 1)    javax.xml.parsers.DocumentBuilderFactory system setting
> 2)    JAVA_HOME/lib/jaxp.properties
> 3)    META-INF/services/javax.xml.parsers.DocumentBuilderFactory
> 4)    The so-called "platform default DocumentBuilderFactory instance".
> 
> Now: In the JAXP reference implementation, Sun ships three JAR files:
> 
> 1)    jaxp.jar - javax.xml.parsers.*
> 2)    crimson.jar
> 3)    xalan.jar
> 
> jaxp.jar contains an implementation of
> javax.xml.parsers.DocumentBuilderFactory. This implementation's
> "newInstance" method does the search using the four steps above. When it
> comes to step number 4, it looks for Crimson.
> 
> So, if tomorrow there'll be another vendor who wants to create a new XML
> parser that follows JAXP, he'll have to write *his own* version of
> javax.xml.parsers.DocumentBuilderFactory; in his own version, he'll make
> newInstance() to look for "my.own.document.builder.Factory" instead of
> "com.sun.blahblah".
> 
> Anyway, he won't be able to use Sun's distributed jaxp.jar. He'll write his
> own implementation, with new bugs, new compatibility issues, etc.
> 
> This, in my opinion, should be avoided; and it can be avoided unless Sun
> removes the 4th search-step.

Yes, you are correct.  I just made a posting regarding this subject on
xerces-j-dev.  So please look there.  I usually use the archives on
marc.theaimsgroup.com.  The latest versions of JAXP RI do not have a
jaxp.jar file.  Everything is contained in a single jar file.  I also
posted some threads about the reasons for doing this a while back ago to
this list probably.

-Edwin

---------------------------------------------------------------------
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


Mime
View raw message