This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Migrating from Oracle XML parser to JDK 1.4 XML parser

 
Juan Luis Baptiste
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tried that before, copied the xsl fils to the same dir of the xml and I still get the same error.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic