Subject: [xsl] Inserting the value of a variable in a result-document From: "Spencer Tickner" <spencertickner@xxxxxxxxx> Date: Mon, 30 Apr 2007 15:26:11 -0700 |
Thanks in advance for the help. Not sure why I'm having such a tough time with this one, but here it goes. I'm using Saxon and XSLT 2.0.
Basically I have a named template I'm calling that inserts a node into a bunch of small xml documents. Hoewever I'm not sure how to do this as the param comming in is out of scope if I was to apply-templates:
file:///c:/test.xml <root> <foo> <bar>of the foo variety</bar> <insert>insert the text after this</insert> <foo> <bar>A deeper bar who is foo</bar> </foo> </foo> </root>
file:///c:/test_new.xml <root> <foo> <bar>of the foo variety</bar> <insert>insert the text after this</insert> the new insert <foo> <bar>A deeper bar who is foo</bar> </foo> </foo> </root>
<xsl:template name="insert_node"> <xsl:param name="myNode"/> <xsl:param name="myInputDoc"/> <xsl:param name="myResultsFile"/> <xsl:variable name="inDoc" select="document($myInputDoc)"/>
<xsl:result-document href="{$myResultsFile}"> <!-- Here I'm not sure what to do with $inDoc, apply-templates with a mode makes me lose $myNode and a for-each doesn't keep my original structure --> </xsl:result-document> </xsl:template>
<xsl:call-template name="insert_node"> <xsl:with-param name="myNode">the new insert</xsl:with-param> <xsl:with-param name="myInputDoc">file:///c:/test.xml</xsl:with-param> <xsl:with-param name="myResultsFile">file:///c:/test_new.xml</xsl:with-param> </xsl:call-template>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Xpath - count preceding-s, Angela Williams | Thread | Re: [xsl] Inserting the value of a , David Carlisle |
Re: [xsl] casting string as integer, Mario Madunic | Date | Re: [xsl] casting string as integer, Mario Madunic |
Month |