This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

xsl:document problem


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]