|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Changing a node value for a variable
Hi,
> Since a variable may contain a node set, is it possible to
> modify the value
> of one node in the variables nodes.
No, but you can make a copy of the node-set bound to the variable and changed it when copying.
> Example:
> <foo>
> <data1>Tom</data1>
> <data2>Jones</data2>
> </foo>
>
> to
>
> <foo>
> <data1>Bridget</data1>
> <data2>Jones</data2>
> </foo>
make a identity transformation, where you have
<xsl:template match="data1/text()[. = 'Tom']">Bridget</xsl:template>
> or is it possible to add a new child node?
>
> Example:
> <foo>
> <data1>Tom</data1>
> <data2>Jones</data2>
> </foo>
>
> to
>
> <foo>
> <data1>Tom</data1>
> <data2>Jones</data2>
> <data3>Bridget</data3>
> </foo>
again, write an identity transformation with
<xsl:template match="foo">
<xsl:copy>
<xsl:apply-templates select="@*|node()" />
<data3>Bridget</data3>
</xsl:copy>
</xsl:template>
Cheers,
Jarno - Apoptygma Berzerk: Nearer
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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
|

Cart








