Keep in mind that there other JDK implementations (e.g. Apache Harmony [1])
besides Sun's and they may include Xalan in its usual org.apache.*
packages. In such cases you still need to use the Endorsed Standards
Override Mechanism, bootclasspath or some ClassLoader wizardry to pick up
the version you want. As for xml-apis.jar, the regular classpath doesn't
work unless you're on JDK 1.3 or lower.

Thanks.

[1] http://harmony.apache.org/

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: [EMAIL PROTECTED]
E-mail: [EMAIL PROTECTED]

Michael Ludwig <[EMAIL PROTECTED]> wrote on 11/21/2008 12:56:46 PM:

> [EMAIL PROTECTED] schrieb:
> > Sanity check, since I haven't been paying enough attention to this
> > thread:
> > You're aware of the distinction between the normal classpath and the
> > "endorsed standards"/system classpath, right?
> >
> > See http://xml.apache.org/xalan-j/faq.html, entry "I'm having a
> > problem running Xalan-Java on JDK/JRE 1.4 or higher".
>
> This says:
>
>    JDK/JRE 1.4, and JDK/JRE 5.0 is packaged with an old version of
>    Xalan-Java. The JDK/JRE will attempt to use this version instead of
>    any on the classpath. Unfortunately, this causes problems when
>    attempting to use a newer version of Xalan-Java.
>
> Don't know about 1.4, but this is not quite true for the following on
> Windows/32:
>
>    * jre1.5.0_06
>    * jre1.6.0_07
>    * jdk1.6.0_07
>
> They do have a version of Xalan, but it has been relocated to another
> package starting with "com.sun".
>
> * TransformerFactory.newInstance() ->
>    com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl
>
> * transformerFactory.newTransformer() ->
>    com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl
>
> Putting Xalan-2.7.1.jar on the CLASSPATH overrides the defaults for
> TransformerFactory and Transformer, because of:
>
>    $XalanJAR/META-INF/services/javax.xml.transform.TransformerFactory
>
> Which contains "org.apache.xalan.processor.TransformerFactoryImpl".
>
> So with 1.5 on Windows (and apparently also on Linux), the problem has
> gone. The Apache-Xalan can be chosen simply by putting the JAR on the
> CLASSPATH.
>
> Michael Ludwig

Reply via email to