How does xsl:if work?

Subject: How does xsl:if work?
From: "Brian Burridge" <brian_burridge@xxxxxxxxxxxxx>
Date: Fri, 02 Jun 2000 15:28:06 -0400
I've read at least 10 arcticles that mention xsl:if, and they all use
the same example. Makes me think that not many of the authors understand
how to use it so they play it safe.

All the examlples use comparisons such as "not(position()=last())".
However, what I want to do is use the if to supress or alter display
based on the value of an attribute.

For example:
<xsl:if test="@team=ALL">
    <td class="th"> Team </td>

where the xml is:
<projects title="Display Projects"
pcode="null" team="ALL" status="null" department="null"
group="project_number" priority="ALL" user="bburridg" >
 <title>This is the title</title>

So the "team" is an attribute of projects and if the team is ALL I want
to add a team column (to label each row with the team), whereas, if the
team is a specific team there is no point in putting that team on every
row, so I'll suppress that column.

Brian N. Burridge
Internet Architect
Ext 3515
The Internet Group - ITSS
Cox Target Media

"Until a person can say deeply and honestly, "I am what I am today
because of the choices I made yesterday," that person cannot say, "I
choose otherwise."

 XSL-List info and archive:

Current Thread