This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: XML Update HOW TO?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]