You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by bu...@apache.org on 2003/10/17 10:47:37 UTC

DO NOT REPLY [Bug 23884] New: - Trax XSLTC can't find some data in XML

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23884>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23884

Trax XSLTC can't find some data in XML

           Summary: Trax XSLTC can't find some data in XML
           Product: XalanJ2
           Version: 2.5Dx
          Platform: PC
               URL: http://www.maniacalboy.com/xalanbug.zip
        OS/Version: All
            Status: NEW
          Severity: Critical
          Priority: Other
         Component: org.apache.xalan.xsltc
        AssignedTo: xalan-dev@xml.apache.org
        ReportedBy: martin.jelen@unicorn.cz
                CC: martin.jelen@unicorn.cz


Hi,
I've encountered a severe problem using the Trax XSLTC transformer that comes 
with Xalan. We've had problems with missing data in some transformed HTML files 
couple of times in the past but now I'm able to reproduce the problem easily.

I'm using Xalan version 2.5.1 (current version that can be downloaded from xml.
apache.org) and recently switched to using the Trax XSLTC engine for 
transformations from XML to HTML. At http://www.maniacalboy.com/xalanbug.zip 
there's a XML file (UC0308.xml) I'm trying to transform, the XSL template 
(UC0308.xsl) I'm using for the transformation and also the resulting HTML files 
I got from both Trax (uc0308.xsltc.html) and the traditional Xalan engine 
(uc0308.xalan.html). The output in uc0308.xalan.html is correct, the one in 
uc0308.xsltc.html is wrong. I stripped down the code in XSL as much as I could, 
so it's easy to see the difference - you can observe the uc0308.xsltc.html file 
is smaller - and missing the only value that's used in the transformation (<xsl:
value-of select="app/PRIJEMZADATEL"/> in the XSL file).
This error occurs only for certain XML structures - if you remove/add even a 
single tag from the source XML file, the transformation works fine!
I tested this only on the Intel platform, on both Redhat Linux 9 and Windows 
2000 and XP. I tried using a newer version of Xerces too (as it seemed it could 
be a parsing error) - 2.5.0 - but it didn't help either.

This is the actual code I'm using for the transformation (minus the exception 
handling). I believe it's correct (and once again - it works when I switch to 
the regular Xalan XSLT engine):

System.setProperty("javax.xml.parsers.DocumentBuilderFactory",
                           "org.apache.xerces.jaxp.DocumentBuilderFactoryImpl");
System.setProperty("javax.xml.parsers.SAXParserFactory",
                           "org.apache.xerces.jaxp.SAXParserFactoryImpl");
System.setProperty("javax.xml.transform.TransformerFactory",
     				"org.apache.xalan.xsltc.trax.TransformerFactoryImpl");

TransformerFactory tFactory = TransformerFactory.newInstance();
Transformer transformer = null;
Templates lTemplates = tFactory.newTemplates(new StreamSource(new 
FileInputStream(aXSLFile)));
transformer = lTemplates.newTransformer();
Properties prop = new Properties();
prop.put("method", "html");
prop.put("indent", "no");
transformer.setOutputProperties(prop);
transformer.transform(new StreamSource(aInFile), new StreamResult(aOutFile));

thanks for any help you can provide!