Hi
 
We are using Xalan 2.7.0 we are facing an issue.
 
This is a snapshot of what we are trying to do:
 
 
 
String xslData = "<?xml version='1.0'?>" +
                "<xsl:stylesheet" +
                " xmlns:xsl='http://www.w3.org/1999/XSL/Transform'" +
                " version='1.0'" +
                ">" +
                "   <xsl:include href=''/>" +
                "</xsl:stylesheet>";
 
        try {
            /* Create a transform factory instance */
            TransformerFactory tfactory = TransformerFactory.newInstance();
            URL location = tfactory.getClass().getProtectionDomain().getCodeSource().getLocation();
            System.out.println("location of TransformerFactoryImpl= " + location);
 
            StringReader in = new StringReader(xslData);
 
            /* Create a StreamSource instance */
            StreamSource streamSource = new StreamSource(in);
            System.out.println("calling newTransformer");
           
            /* Try to create Transformer object for the stylesheet */
            tfactory.newTransformer(streamSource);

            System.out.println("TransformerException not thrown");

        } catch (TransformerException e) {
            System.out.println("TransformerException Thrown");
            e.printStackTrace();
        }
 
So the xsl included by the above xml abc.xsl does not exist. So that should lead to an TransforerConfigurationException being thrown.
Hence it would lead the the System.out being printed at catch(TransformerException) as its the parent exception.
 
But the output we got is:
 
 
location of TransformerFactoryImpl=  file:/D:/endorsed/xalan.jar
calling newTransformer
TransformerException not thrown
SystemId Unknown; Line #1; Column #133; Had IO Exception with stylesheet file: abc.xsl
 
While running with java 1.5.0_05, the exception was thrown:
The output was:
 
 
calling newTransformer
ERROR:  'D:\code\R&D\src\abc.xsl (The system cannot find the file specified)'
FATAL ERROR:  'Could not compile stylesheet'
TransformerException Thrown
javax.xml.transform.TransformerConfigurationException: Could not compile stylesh
eet
        at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.n
ewTemplates(TransformerFactoryImpl.java:824)
        at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.n
ewTransformer(TransformerFactoryImpl.java:619)
        at URIResolverTest.main(URIResolverTest.java:50)
 
 
Here the location from where it loaded the TransformerFactoryImpl cant be printed as that would throw an npe (rt.jar has it)
 
While searching for the bug we could see a cvs-commit log for the same at http://mail-archives.apache.org/mod_mbox/xml-xalan-cvs/200310.mbox/[EMAIL PROTECTED] (Resolve002 tck)
 
Also While trying out with xalan-j_2_4_1 for jaxp 1.2 the exception was thrown.
 
But xalan 2.7.0 for jaxp 1.3 does not throw the exception.
 
Any suggestions would be of great help.
 
Thanks
 
-Bharath
 
 
 
 
 
 
 
 

Reply via email to