You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Christian Bjørnbak <bj...@iuas.dk> on 2001/01/23 16:26:37 UTC

Path bug in Xalan..

Hi

We are having problems with Xalan and path's..

We a using Xerces and Xalan in a Web (servlet) enviroment to create
dynamicly transformed HTML from XML files.

Originally I wanted to use Xalan like:

DocumentBuilder builder = factory.newDocumentBuilder();
Document document = builder.parse( "someXmlFile" );

doSomethingWithTheDom(document);

XSLTProcessor proc = XSLTProcessorFactory.getProcessor(new
org.apache.xalan.xpath.xdom.XercesLiaison());

proc.process(new XSLTInputSource(document), null, new
XSLTResultTarget(response.getWriter()));

And get the stylesheet specification from the XML file, but then Xalan will
look for the stylesheet relativ to the Java working directory instead of
relativ to the XML file!!

OKAY, I solved that by parsing the XML file and get the style specifcation
manually and the parse to Xalan by:
proc.process(new XSLTInputSource(document), new
XSLTInputSource(getStyleSheet(document)), new
XSLTResultTarget(response.getWriter()));

But my problem contiues because some of our stylesheets include other
stylesheets which gives the same problem!!

I could fix this manually by recursivly replacing all <xsl:include>'s with
the actual DOM, but I think this a common issue needing to be solved in
Xalan.

BTW: It isn't a solution to use absolute paths because the XML author
(content creator) doesn't and shouldn't know anything about the directory
structure..

BTW 2: I have tested it on Windows 2000 with Sun JDK 1.3, Oracle VM 1.2.2
and Linux with IBM JDK 1.1.8 and 1.3.0!

Any idea's?

Christian Bjørnbak
Integrator Uniware A/S