my dog learned polymorphism*
The moose likes XML and Related Technologies and the fly likes Migrating from Oracle XML parser to JDK 1.4 XML parser Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Migrating from Oracle XML parser to JDK 1.4 XML parser " Watch "Migrating from Oracle XML parser to JDK 1.4 XML parser " New topic
Author

Migrating from Oracle XML parser to JDK 1.4 XML parser

Juan Luis Baptiste
Greenhorn

Joined: Mar 07, 2005
Posts: 2
Hi,

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.

Any help would be appreciated.
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
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
Greenhorn

Joined: Mar 07, 2005
Posts: 2
Tried that before, copied the xsl fils to the same dir of the xml and I still get the same error.
 
Consider Paul's rocket mass heater.
 
subject: Migrating from Oracle XML parser to JDK 1.4 XML parser
 
Similar Threads
XML Transformation error
Incorrect encoding in XML
DocumentBuilder.parse not working for String input
Loading XSL template from URL for transformation
Streaming XML files through an XSL transform into a SAX parser