[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: libxalan-java



Jan Schulz <jasc.usenet@gmx.de> writes:

> Ok, so I misunderstood, what the libxalan-java package is about. On
> the other hand, I don't understand things like that then:
>
> apt-cache show fop:
> [...]
> Depends: java-common, j2re1.3 | j2re1.4 | java2-runtime,
> libxerces-java, libxalan2-java, libbsf-java (>> 20010106-2),
> liblogkit-java, libavalon-framework-java (>= 4.1.2-2), libbatik-java
> (>= 1.5final)
>
> It seems that some packages use xalan directly and having it upgrading
> to a newer breaking API version will break this apps. Therfore I think
> it would make some sense to treat this packages 'as API' as long as we
> have software, which uses internal API.

There is only *one* file that has a the string 'xalan' in fop:

/tmp/fop-0.20.5/src/org/apache/fop/tools/xslt/XSLTransform.java

    private static Class getTransformClass() {
        try {
            // try trax first
            Class transformer =
                Class.forName("javax.xml.transform.Transformer");
            // ok, make sure we have a liaison to trax
            transformer =
                Class.forName("org.apache.fop.tools.xslt.TraxTransform");
            return transformer;

        } catch (ClassNotFoundException ex) {}
        // otherwise, try regular xalan1
        try {
            Class transformer =
                Class.forName("org.apache.xalan.xslt.XSLTProcessor");
            // get the liaison
            transformer =
                Class.forName("org.apache.fop.tools.xslt.Xalan1Transform");
            return transformer;
        } catch (ClassNotFoundException ex) {}
        return null;

    }

If FOP find a TrAX compliant transformer, then, the Class.forName() is
not called.

Everything with xsl(t) transformation must be calls to the TrAX API
(javax.xml.transform.*) There are three different mechanisms to find the
compliant TrAX implementation.

>From gnujaxp:

~/gnu-classpathx/jaxp/source/javax/xml/transform/TransformerFactory.java

	/**
	 * Returns a new TransformerFactory.  The name of this class
	 * is found by checking, in order:
	 * the <em>javax.xml.transform.TransformerFactory</em>
	 *	system property,
	 * <em>$JAVA_HOME/lib/jaxp.properties</em> for the key with
	 *	that same name,
	 * JAR files in the class path with a <em>META-INF/services</em>
	 *	file with that same name,
	 * else the compiled-in platform default.
	 */
	public static TransformerFactory newInstance() 
	throws TransformerFactoryConfigurationError

http://java.sun.com/xml/jaxp/docs.html

> I have no idea, how fop uses xalan, but if it is like 'call the app',
> then libxalan-java should probably become 'xalan' anyway.

No, it's not that way.

> Another 'IMO': Everything with lib in front should be 'library
> packaged'. Otherwise it wouldn't be 'lib' (I know that this isn't true
> with some normal packages, but... :)

True ;)

-- 
  .''`. 
 : :' :rnaud
 `. `'  
   `-    



Reply to: