xsl-list
[Top] [All Lists]

Re: [xsl] Inserting the value of a variable in a result-document

2007-04-30 15:39:08

don't do

<xsl:with-param name="myInputDoc">file:///c:/test.xml</xsl:with-param>

(which forces the system to (act as if it had to) generate a temporary
tree with a new document node with a text node child, which is expensive
to build if all you are going to do is coerce back to a string, instead
do

<xsl:with-param name="myInputDoc" select="'file:///c:/test.xml'"/>

or just pass in the document  rather than a string

<xsl:with-param name="myInputDoc" select="doc('file:///c:/test.xml')"/>


I wouldn't use named templates at all for this, just have an identity
template

<xsl:template match="*">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>

and a template for insert that inserts stuff:


<xsl:template match="insert">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates/>
</xsl:copy>
<xsl:text>the new insert</xsl:text>
</xsl:template>

David



________________________________________________________________________
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs. 
________________________________________________________________________

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>