By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,246 Members | 2,131 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,246 IT Pros & Developers. It's quick & easy.

"if tests" and spaces

P: n/a
The transform below should create a dropdown where the
entry for "SSS Building I" is selected. (Or am I missing something? )

This transform creates the dropdown but doesn't do the select.

Can "if tests" work when there are spaces?

Thanks

<xml_data>
<building>SSS Building I</building>
</xml_data>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"
doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
encoding="UTF-8"/>

<xsl:template match="/">

<select name="building">
<option selected="selected">
<xsl:if test="not(/xml_data/building)">
<xsl:attribute name="selected">selected</xsl:attribute>
</xsl:if>Select One
</option>
<option value="SSS Building I">
<xsl:if test="/xml_data/building='SSS Building I'">
<xsl:attribute name="selected">selected</xsl:attribute>
</xsl:if>SSS Building I
</option>
<option value="SSS Building II">
<xsl:if test="/xml_data/building='SSS Building II'">
<xsl:attribute name="selected">selected</xsl:attribute>
</xsl:if>SSS Building II
</option>
<option value="HHH Building III">
<xsl:if test="/xml_data/building='HHH Building III'">
<xsl:attribute name="selected">selected</xsl:attribute>
</xsl:if>HHH Building III
</option>
</select>

</xsl:template>

</xsl:stylesheet>
Jul 20 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.