This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: XML Update HOW TO?
- To: Cristobal Galiano Fernandez <c dot galiano at ua dot es>
- Subject: Re: [xsl] XML Update HOW TO?
- From: Jeni Tennison <mail at jenitennison dot com>
- Date: Sat, 13 Jan 2001 09:03:59 +0000
- CC: xsl-list at lists dot mulberrytech dot com
- Organization: Jeni Tennison Consulting Ltd
- References: <3A5F174B.51C2C7C5@ua.es>
- Reply-To: xsl-list at lists dot mulberrytech dot com
Hi Cristóbal,
> <xsl:variable name="W">
> <xsl:value-of
> select="concat('Paginas/Pagina[@Tipo='New']/','')" />
> <xsl:value-of select="concat('texto','')" />
> <xsl:text>[@ID='Etiqueta12']</xsl:text>
> </xsl:variable>
>
> but my problem is that <xsl:value-of select="$W" /> return the string
> Paginas/Pagina[@Tipo=]/texto[@ID='Etiqueta12'] not the node-set
You're getting that problem because you're concatenating lots of text
togther rather than building the node set :)
What you want to do is find the Pagina with @Tipo = 'New', then find
within that the 'texto' element that has an @ID equal to 'Equita12'.
In fact, the string that you constructed is almost the XPath that you
need:
/Paginas/Pagina[@Tipo='New']/texto[@ID='Etiqueta12']
Note the '/' at the beginning - that says "go back to the root node
and navigate from there". Without that '/', you'd be looking for
'Paginas' children of the *current node*, which isn't what you want.
So to set the variable 'W' to this node set (all the textto elements
with @ID equal to 'Etiqueta12'), use:
<xsl:variable name="W"
select="/Paginas/Pagina[@Tipo='New']/texto[@ID='Etiqueta12']" />
I hope that helps you get over this hurdle,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list