This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: splitting one xml into many xml documents using xsl
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] splitting one xml into many xml documents using xsl
- From: "Chris Bayes" <Chris at Bayes dot co dot uk>
- Date: Fri, 9 Mar 2001 19:18:43 -0000
- Reply-To: xsl-list at lists dot mulberrytech dot com
Meraga,
Try something like this
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
xmlns:xt="http://www.jclark.com/xt"
xmlns:saxon="http://icl.com/saxon"
xmlns:xalan="http://www.apache.org/xalan"
>
<xsl:template match="address_object">
<xsl:for-each select="*">
<xt:document method="xml" href="{name()}.xml">
<xsl:copy-of select="." />
<xsl:fallback />
</xt:document>
<saxon:output method="xml" href="{name()}.xml">
<xsl:copy-of select="." />
<xsl:fallback />
</saxon:output>
<xalan:write method="xml" href="{name()}.xml">
<xsl:copy-of select="." />
<xsl:fallback />
</xalan:write>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
There is no xslt solution you have to use a processor extension function
until xslt 1.1 comes along. This should work on 3 processors although i
quickly tested it with xt for a change ;-)
Ciao Chris
XML/XSL Portal
http://www.bayes.co.uk/xml
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list