This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
xsl:document problem
- From: "Khalid"<k_ali at telusplanet dot net>
- To: XSL-List at lists dot mulberrytech dot com
- Date: Tue, 5 Feb 2002 17:02:50 GMT
- Subject: [xsl] xsl:document problem
- Reply-to: xsl-list at lists dot mulberrytech dot com
Hello,I am trying to create multiple out put files(xml).
Can some on elet me know whats wrong with my code,cus it seem to go to otherwise
element everytime I run it.
XSLT processor I am using is xalan.Here is the code
<xsl:template match = "address">
<xsl:variable name = "file" select = "concat('address',position(),'.xml')"/>
<address number = "{position()}" href = "{$file}"/>
<xsl:choose>
<xsl:when test = "element-available('xsl:document')">
<xsl:document href = "{$file}">
<xsl:copy-of select = "."/>
</xsl:document>
</xsl:when>
<xsl:otherwise>
<xsl:message terminate = "yes">Sorry, can not write to multiple outputs.</xsl:message>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
below is the xml file I am using
<?xml version='1.0'?>
<root>
<sub-root>
<address>
<street>400,703 6th Ave SW</street>
</address>
<address>
<street>176 Martinvalley Crescent NE</street>
</address>
</sub-root>
</root>
Thanks for help
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list