Re: [xsl] about xsl:when

Subject: Re: [xsl] about xsl:when
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 8 Mar 2001 16:39:56 GMT
] <xsl:template match = "persona[@id]" > 

that matches persona elements that have an id.
so . is the _element_ node  and in ".='1' you are testing
the string value of the element (ie all the character data in all its
descendents) against '1'.

I would guess you want "@id='1'

Incidentally you might prefer not to have an xsl:choose at all but just
do it in the match:

<xsl:template match = "persona[@id=1 or @id=2]" priority="2">
      edad=<xsl:value-of select="name"/> 

<xsl:template match = "persona[@id]" > 
      <xsl:text >no hay</xsl:text> 

<xsl:template match = "persona" > 
      <xsl:text >no id attribute at all</xsl:text> 


This message has been checked for all known viruses by Star Internet delivered
through the MessageLabs Virus Control Centre. For further information visit

 XSL-List info and archive:

Current Thread