Dear all,
I don't understand why my script is correctly working, but fails to create the output file using the xsl:result-document tag.
Code:
<xsl:template match="/">
<xsl:variable name="uri" select="concat($output-dir, '/', '.xml')"/>
<xsl:result-document href="$uri">
<xsl:apply-templates select="$main-doc" mode="once" />
</xsl:result-document>
</xsl:template>
$main-doc is a document-node() variable storing the original XML tree. I use that in order to avoid recalling the template several times (along with the attribute mode). I'm sure the script does what I want, because if I remove xsl:result-document, as showed below, I get the correct output on screen. But the problem is that no file is generated if I keep xsl:result-document.
Is there a way to use xsl:result-document and generate one single output file? (I know I could use the command line to set the output file, but for consistency with other scripts I need to use xsl:result-document)
PS: I'm using XSLT 2.0 and an interpreter that can manage it (I run other scripts generating multiple output files with xsl:result-document without any problems, the only difference is that in those cases I really generate multiple files by nesting xsl:result-document into a xsl:for-each and using "position()" to build the $uri)
Thanks in advance for your help!!!
EastvanAxon