Erik
Erik

Reputation: 954

Include one result-document into another

In an .xslt transformation, I generate an xhtml file by way of <xsl:result-document>. Later on in the same transformation, I generate another (also xhtml) in which I want to include the first xhtml file (with some <xsl:copy> instruction). So: let XSLT combine two files in ONE transform. Can that be done? (I suspect the first cannot be used yet, as it is only closed when the complete transformation is done.)

Upvotes: 0

Views: 49

Answers (2)

Michael Kay
Michael Kay

Reputation: 163458

Later on in the same transformation

It's hard to help without seeing your code/input/output, but alarm bells ring when I see temporal words like "later". The execution model for a function language does not involve any concept of time, or changing state. You don't know what order things are done in. There can be functional dependencies - if a depends on b, then in practice b has to be computed before a - but even that is dangerous to rely on, because of partial/parallel computation.

Upvotes: 2

Ian Roberts
Ian Roberts

Reputation: 122394

If you can get the variable scopes right then you could generate the initial nodes into a variable rather than directly into a result-document, then you can include the contents of that variable wherever you need it with <xsl:sequence select="$variableName"/>.

Upvotes: 1

Related Questions