Hello all,
I'm creating a stylesheet, which should give me multiple output files. For
this feature, XSLT2.0 provides xsl:result-document. Unfortunately, the
wished output is not provided.
My input file looks like this (simplified version):
--------------------------------------------------------------
<?xml version="1.0" encoding="UTF-16"?>
<sourceroot>
<class name="Input1" id="a123">
<contains value="input1"/>
</class>
<class name="Input2" id="b456">
<contains value="input2"/>
</class>
<class name="Input3" id="c789">
<contains value="input3"/>
</class>
</sourceroot>
--------------------------------------------------------------
My stylesheet looks like this (also simplified):
--------------------------------------------------------------
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" indent="yes"/>
<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="sourceroot">
<xsl:for-each select="//class">
<xsl:result-document href="{(_at_)name}(_dot_)java">
<xsl:value-of select="@name"/>
</xsl:result-document>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
--------------------------------------------------------------
The output I get, is Input1.java; but I want to get Input1.java;
Input2.java; Input3.java.
To convert, I use the Altova XSLT 2.0 Engine.
Can somebody tell me what's wrong with my code. I've searched the web for
problems with xsl:result-document and xsl:for-each used together, but I
cannot find anything. I've seen examples in which they are used in the same
way as I do...
Thanks in advance.
Kind regards,
Els Maes
_________________________________________________________________
Volg Expeditie Robinson op de voet! http://www.expeditierobinson.vt4.be/