This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: about xsl:when
- To: xsl-list at lists dot mulberrytech dot com
- Subject: Re: [xsl] about xsl:when
- From: David Carlisle <davidc at nag dot co dot uk>
- Date: Thu, 8 Mar 2001 16:39:56 GMT
- References: <24389200134816194796@energystudios.com>
- Reply-To: xsl-list at lists dot mulberrytech dot com
] <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">
<br/>
edad=<xsl:value-of select="name"/>
</xsl:template>
<xsl:template match = "persona[@id]" >
<br/>
<xsl:text >no hay</xsl:text>
</xsl:template>
<xsl:template match = "persona" >
<br/>
<xsl:text >no id attribute at all</xsl:text>
</xsl:template>
David
_____________________________________________________________________
This message has been checked for all known viruses by Star Internet delivered
through the MessageLabs Virus Control Centre. For further information visit
http://www.star.net.uk/stats.asp
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list