Operation Manual

488
USING DREAMWEAVER
Displaying XML data with XSLT
Last updated 3/28/2012
In the following example, you want to test to see if the context node’s price subelement is less than 5.
3 Click OK.
In the example, the following code is inserted in your XSLT page:
<xsl:choose>
<xsl:when test="price&lt;5">
Content goes here
</xsl:when>
<xsl:otherwise>
Content goes here
</xsl:otherwise>
</xsl:choose>
4 To insert another condition, place the insertion point in Code view between <xsl:when> tag pairs or just before
the
<xsl:otherwise> tag, and then insert a conditional region (Insert > XSLT Objects > Conditional Region).
After you specify the condition and click OK, another <xsl:when> tag is inserted in the <xsl:choose> block.
For more information and examples on writing conditional expressions, see the <xsl:choose> sections in the
Reference panel (Help
> Reference).
Set conditional region (If) properties
The purpose of the Set Conditional Region Property inspector is to change the condition used in a conditional region
in your XSL page. The conditional region tests the condition and takes a course of action based on the result.
In the Test box, enter a new condition, and then press Enter.
Set conditional (When) properties
The purpose of the Set Conditional Region Property inspector is to change the condition used in a multiple conditional
region in your XSL page. The multiple conditional region tests the condition and takes a course of action based on the
result.
In the Test box, enter a new condition, and then press Enter.
Insert XSL comments
You can add XSL comment tags to a document, or you can wrap a selection in XSL comment tags.
Add XSL comment tags to a document
Do one of the following:
In Design view, select Insert > XSLT Objects > XSL Comment, type the contents of the comment (or leave the box
blank), and click OK.
In Code view, select Insert > XSLT Objects > XSL Comment.