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]

RE: splitting one xml into many xml documents using xsl


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


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