RE: if testing elements

Subject: RE: if testing elements
From: "Richard Lander" <rlander@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 1 Nov 1999 17:57:05 -0500

Why not try:

<xsl:template match="FOO/GREEN">
         ... do something for Green BAR

I hope that helps,


-----Original Message-----
From: owner-xsl-list@xxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxx]On Behalf Of Michael Welz
Sent: Monday, November 01, 1999 5:29 PM
To: XSL-List@xxxxxxxxxxxxxxxx
Subject: xsl:if testing elements

How can I use xsl:if to test for a particular element value using

For the xml:

  <BAR> Green </BAR>

And the xsl:

<xsl:template match="FOO">
   <xsl:if test="BAR = 'Green'">
         ... do something for Green BAR

If BAR was an attribute of FOO, I can do "@BAR = 'Green'" with no problems,
but I don't want to base my selection attributes/elements on an
implementation (possibly?) detail like that.

I have in the past used ".[BAR = 'Green']" but that gives me a syntax error



 XSL-List info and archive:

 XSL-List info and archive:

Current Thread