xsl-list
[Top] [All Lists]

Re: if statement

2003-07-02 10:09:08

Am 2003.07.02 17:18 schrieb(en) Andrew Welch:

> How can I test if my current node has a attribute named 'wrap' and
if
> it has the value 'yes' I would have to add some things with
<xml:text>
> if 'wrap' does not exist or it is 'no', I don't want to add this
things.

Hi,

Use choose / when:

<xsl:choose>
  <xsl:when test="@wrap='yes'">
    <wrap>
      <xsl:apply-templates/>
    </wrap>
  </xsl:when>
  <xsl:otherwise>
    <xsl:apply-templates/>
  </xsl:otherwise>
</xsl:choose>

Thanks for all the answers I got here.

This one seems to be good for me.  There are troubles just makeing:

<xsl:when test="@wrap='yes'">
  </tr><tr>
</xsl:when>

I think I have to make everything inside the when clause. I think I can handle that.

Thanks,
Martin

--
If you've got an idea and need help,
or just need general encouragement,
write me a message. ;-)

XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>