adam_0
adam_0

Reputation: 7190

Creating multiple XML files from one vanilla XSLT

I have several different XSLT files that all work on the same original XML file to produce four different XML file outputs. Is it possible to make all these XSLT files into one using vanilla XSLT (that is, not using XALAN or anything that's XSLT-parser specific)?

All help is appreciated and thanks in advance!

Upvotes: 0

Views: 950

Answers (2)

Mads Hansen
Mads Hansen

Reputation: 66714

It is possible to produce multiple files from a single XSLT, in an XSLT 2.0 styelsheet.

In XSLT 2.0 xsl:result-document can be used multiple times to produce multiple output files.

Depending on how the individual XSLT stylesheets are written, you may be able to import or include the stylesheets into a "parent" stylesheet that uses xsl:result-document to execute different named templates or apply-templates with different context and/or modes to output the different files.

Upvotes: 2

Rubens Farias
Rubens Farias

Reputation: 57926

You could to use <xsl:import>

EDIT

No, this code will not generate four XML files, but merge several XSLT files to be processed as one. You can't achieve that without interacting with your XSLT processor, as XSLT itself doesn't care about files, just to translate a XML format into another.

Upvotes: 0

Related Questions