|
January 7, 2002 Printing Conditional Templates in XSLT Tips: January 2002
Yehuda Shiran, Ph.D.
|
|
Conditional templates are output only if certain conditions exist within the source document. Conditional templates are defined with either <xsl:if> or <xsl:choose> elements. In the following report card, the grade element has an attribute named graduate. You might want to generate some output (a * next to the grade, for example) only when this attribute has a certain value:
Here is XSL code that will test the graduate field and will print a * if the answer is positive:
People who read this tip also read these tips: Look for similar tips by subject: |