This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: XSL manipulating two XMLs


Najmi, Jamal wrote:
> I am using xalan for transformation in tomcat servlet engine.  I copy the
> two XML files and the XSL to a directory created on the fly, import one XML
> file into XSL and pass the other one via the Xalan API.  Every thing shoud
> work except that XSL transformer starts looking for the imported XML file
> not in the currtent directory but in the TOMCAT_HOME/bin directory!!! I
> tried putting ./ infront of the imported file name but no use.  
> 
> Hoe can I make the transformer look into the current directory for the
> included file: 

It seems it actually looked into the current working directory
for the process.

> Here is how  I am importing the XML document:
> 
> <xsl:variable name = "contentXml" select ="document('content.xml')"/>

I'm unsure what you situation you acutally have. If both
the XML file passed to the transformer object and the file
referenced by the document() function are in the same directory,
try:
   <xsl:variable name = "contentXml" select ="document('content.xml',/)"/>
                                                                    ^^
No quotes arount the slash, it denotes the root node of
the XML document you passed to the transformer object.


BTW you are supposed to trim unnecessary "original messages"
from time to time.

J.Pietschmann



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]