Subject: Re: [xsl] redirecting ouput to a different file? From: Dan Vint <dvint@xxxxxxxxx> Date: Thu, 18 Aug 2011 18:07:57 -0700 |
At 2011-08-18 17:49 -0700, Dan Vint wrote:So I can drop that <xsl:result-document href="DMC-{modelic}-{sdc}-{chapnum}-.... into all of my templates?
No ... not all. You build the result tree under <xsl:result-document> that is targeted for that file. <xsl:result-document> just starts the building of a new result tree and you build it just like you build the default result tree when not using that instruction.
I hadn't found any complex examples in my searches, but was hoping it would work like what you describe.
It does work like I describe, but I don't think you see how I'm describing it:
<xsl:template match="avee"> <xsl:result-document href="DMC-{modelic}-{sdc}-{chapnum}-.... <xsl:apply-templates select="..."/> </xsl:result-document> </xsl:template>
<xsl:template match="whatever"> ... some stuff that goes into that result document... </xsl:template>
The <xsl:apply-templates/> above will end up building nodes under <xsl:result-document/> even if that building is done from other templates. You mustn't copy the <xsl:result-document> into the other templates.
Once you finish building the tree and you process something after the <xsl:result-document> instruction, the tree is done with and the file is written (though likely it was being written along the way).
BTW, you can nest the instructions in order to create a separate file on the side while you are in the middle of creating another file. You just cannot re-open an <xsl:result-document/> file and add to it.
I hope this clarifies things for you.
. . . . . . . . . Ken
-- Contact us for world-wide XML consulting & instructor-led training Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Legal business disclaimers: http://www.CraneSoftwrights.com/legal
--------------------------------------------------------------------------- Danny Vint
Panoramic Photography http://www.dvint.com
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] redirecting ouput to a di, G. Ken Holman | Thread | Re: [xsl] redirecting ouput to a di, Andrew Welch |
Re: [xsl] redirecting ouput to a di, G. Ken Holman | Date | Re: [xsl] stop the processing of de, David Carlisle |
Month |