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: about xsl:when



] <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


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