RE: [xsl] xsl if statement

Subject: RE: [xsl] xsl if statement
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Wed, 16 Aug 2006 14:22:14 +0100
> > <xsl:template match="child">
> > <xsl:if test="'[child=&#x21C4]'">
> try:
> <xsl:if test=".=&#x21C4;">
> 
> first remove apostroph.
> second you already matched child element. use only dot. 

You caught two of his errors but missed the third. It should be

<xsl:if test=".='&#x21C4;'">

Personally, I would write

<xsl:template match="child[.='&#x21C4']">
<span style="color:red">
  <xsl:apply-templates/>
</span>
</xsl:template>

<xsl:template match="child"/>

Michael Kay
http://www.saxonica.com/

Current Thread