Using xsl to transform single XML doc to multiple docs?

In XSLT 1.0 it isn't possible to create more than one tree as the output of any transformation but in XSLT 2.0 this can be done really easy In XSLT 1.0 one could use the exsl:document extension element of EXSLT Or, one can have a transformation, that is provided a global (and externally specified) parameter, containing the element name of the element that must be extracted into a single document: xsl:stylesheet version="1.0" xmlns:xsl="" rel="nofollow">w3.org/1999/XSL/Transform"> Doc 1 Content Doc 2 Content Doc 3 Content Doc 1 Content Doc 1 Content Doc 2 Content Doc 3 Content Xml Writing to file:/C:/Program%20Files/Java/jre6/bin/doc3. Xml Execution time: 151 milliseconds Memory used: 11467936 NamePool contents: 18 entries in 18 chains. 6 prefixes, 6 URIs.

In XSLT 1.0 it isn't possible to create more than one tree as the output of any transformation, but in XSLT 2.0 this can be done really easy. In XSLT 1.0 one could use the extension element of EXSLT. Or, one can have a transformation, that is provided a global (and externally specified) parameter, containing the element name of the element that must be extracted into a single document: when applied on this XML document (based on the provided one): Doc 1 Content Doc 2 Content Doc 3 Content the wanted result is produced: Doc 1 Content And you will run this transformation once for every element, whose sub-tree should be extracted into a separate document.

Here is an XSLT 2.0 solution: When this transformation is applied on the following XML document (based on the provided one): Doc 1 Content Doc 2 Content Doc 3 Content The result is correctly output to three documents: Saxon 9.1.0.5J from Saxonica Java version 1.6.0_21 Stylesheet compilation time: 868 milliseconds Loading net.sf.saxon.event. MessageEmitter Writing to file:/C:/Program%20Files/Java/jre6/bin/doc1. Xml Writing to file:/C:/Program%20Files/Java/jre6/bin/doc2.

Xml Writing to file:/C:/Program%20Files/Java/jre6/bin/doc3. Xml Execution time: 151 milliseconds Memory used: 11467936 NamePool contents: 18 entries in 18 chains. 6 prefixes, 6 URIs.

1 Excellent answer including XSLT 1.0 without extensions solution! – user357812 Sep 13 '10 at 13:39.

We had that problem once and solved it by slightly cheating: step 1: create one big file containing different xml scripts separated by program instructions or comments. Step 2: use a program to cut the file into separate files. Note that your intermediate result is invalid xml, but the end result is valid.

Example .. .. ..

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions