This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
We are migrating some code that uses Oracle XML and XSL parsers to transform an XML document into HTML. We are doing this because we found with some tests that the jdk 1.4 parser is faster than Oracle's (like 50% faster in our case). The XSL file that we need to parse includes a lot of other XSL files wth the xsl:include directive. When migrating to the jdk 1.4 parser, the parser only works if *all* XSL files are merged into one single file. If not, this is the error we get when the parser tries to include the first XSL file:
XSL-1000: (Fatal Error) Error while parsing XSL file (<Line 4, Column 37>: XSL-1002: (Error) Error while processing include XSL file (titdetter.xsl).).
The failing code is this one:
Where aXml is the XML file to transform and aXsl is the style sheet to use for the transformation. The error appears when runing the last line.
Originally posted by Juan Luis Baptiste: Hi, document = builder.parse(new FileInputStream("/xmltmp/" + aXml)); StreamSource styleSource = new StreamSource(new FileInputStream(Path + "xsl/" + aXsl)); [/CODE]
Welcome to Javaranch Juan! I guess the problem is because of the xml parser file-cursor looking at /xmltmp/ directory while xsl files were at xsl/ directory. Guess you have to play around with directory hierarchy either in the java code levl or at the xsl:include level.
Juan Luis Baptiste
Joined: Mar 07, 2005
Tried that before, copied the xsl fils to the same dir of the xml and I still get the same error.