Re: [xsl] xsl:if / variables / fancy / confusing

Subject: Re: [xsl] xsl:if / variables / fancy / confusing
From: Geert Josten <Geert.Josten@xxxxxxxxxxx>
Date: Thu, 17 Nov 2005 23:17:34 +0100
I was thinking:

<select name="attribute_{attribute_id}">
<xsl:if test="/configuration/details/errors/attribute_{attribute_id}"><xsl:attribute name="style">xyz</xsl:attribute></xsl:if>


but it doesn't like that AT ALL.

Hi Johnathon,


You cannot use attribute value templates within attributes that are expected to contain XPath expressions themselves. Not a very nice solution, but you could use:

<xsl:if test="/configuration/details/errors/*[local-name() = concat('attribute_', attribute_id)]">
  <xsl:attribute name="style">xyz</xsl:attribute>
</xsl:if>

Regards,
Geert

Current Thread