Subject: Re: [xsl] How to use document() of doc() function with copy idiom, or how to acc From: Abel Braaksma Online <abel.online@xxxxxxxxx> Date: Tue, 25 Jul 2006 21:37:44 +0200 |
Cheers, Abel Braaksma Nuntia B.V.
I replaced it with <xsl:copy-of select="doc(xxx)" /> and now it works.
It works, but it's very expensive on memory. You end up with two copies of your input document in memory, the first one, loaded with doc() and a second new document stored in $documents that has a different structure and _copies_ of all the nodes of the first.
It's not clear why you need to wrap your source document in a new <doc> element before applying templates, if instead you wrnt
<xsl:variable name="document" select="document($input-file)"/>
then $document would be the (original) document node.
You would then just generate the <doc> element on output,
<xsl:template name="main" match="/">
<output>
<doc>
<input-filename><xsl:value-of select="." /></input-filename>
<xsl:apply-templates select="$document/*" mode="copy" />
</doc>
</output>
</xsl:template>
David
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] How to use document() of , David Carlisle | Thread | Re: [xsl] How to use document() of , Abel Braaksma Online |
Re: [xsl] $variables with xsl:key(), Steve | Date | Re: [xsl] $variables with xsl:key(), Wendell Piez |
Month |