[Home] [By Thread] [By Date] [Recent Entries]
One way to make the current working directory known to the stylesheet is
to pass it as a parameter:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> <xsl:output method="text"/> <xsl:param name="currentdir" /> <xsl:variable name="current-base-uri" select="concat('file:///', replace($currentdir, '\\', '/'))" /> <xsl:template name="main"> <xsl:sequence select="unparsed-text(concat($current-base-uri, '/', 'test.txt'))" /> </xsl:template> </xsl:stylesheet> Suppose the stylesheet is c:\otherdir\test.xsl and there's a text file test.txt with contents 'TEST' in the current working directory. Then: C:\Users\gerrit>type test.txt TEST C:\Users\gerrit>java net.sf.saxon.Transform -xsl:c:/otherdir/test.xsl -it:main currentdir=%CD% TEST I'm not sure I fully understood the requirement and whether there are more 'canonical' ways to access the CWD in XSLT processors. (And I'm not the Windows shell expert.) But I hope it is helpful anyway. -Gerrit On 29.08.2010 04:53, ac wrote: Hi,
Registergericht / Commercial Register: Amtsgericht Leipzig Registernummer / Registration Number: HRB 24930 GeschC$ftsfC<hrer: Gerrit Imsieke, Svea Jelonek, Thomas Schmidt, Dr. Reinhard VC6ckler
|

Cart



