[xslt] Spaces and <xsl:document href="..."> element.

Hello xslt,

  I use xsltproc (and XSLT) to generate some reports for each directory in tree. Process works like this:

  (1) Perl script recurses tree and generate ONE XML file, which contains tree with gathered information. Output is like this:

<dir name="/">
  <dir name="dir1">
     <desc>Some description</desc>
     <dir name="dir2">
  <file name="file1">

  (2) I use XSLT to generate HTML report in each directory in tree, using XSML froms step (1) as input document. I use recursive template, which take parameter "cwd" and construct current path in tree by this parameter and "name" attribute of current (processed) <dir> element. I generate reports into directories with using XSLT 1.1 <xsl:document> instruction:

<xsl:template match="dir">
  <xsl:param name="cwd" select="'.'" />
  <xsl:document mode="html" encoding="windows-1251"
   href="{$cwd}/{ name}/index.html"
    <xsl:with-param name="cwd" select="concat($cwd,'/',@name)" />

  Everything works, except one thing: if directory's name contains spaces (<dir name="with spaces">...</dir>), xsltproc trys to open file:


 And it FAILS (of course!). Is it xsltproc's (libxslt's) bug or I do something wrong?

  How could I workaround this problem?

Best regards,
 Lev                          mailto:lev serebryakov spb ru

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]