[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: How to use document() of doc() function with copy
> 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|