Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combo box fill up

Status
Not open for further replies.

ibike

Programmer
Apr 7, 2003
27
0
0
IT
Hello,
I've this template which fill up a combo box by the .xml file results but my problem that I always get just the firs result from the .xml file.

<xsl:template match=&quot;listdata/vatlist&quot;>
<select class=&quot;bodydisplaytext&quot; name=&quot;vat&quot;>
<xsl:if test=&quot;count/Response/listdata/vatlist/Code) > 1&quot;>
<option value=&quot;&quot;>ALL</option>
</xsl:if>
<xsl:for-each select=&quot;/Response/listdata/vatlist/Code&quot;>
<xsl:variable name=&quot;SelectedItem&quot; select=&quot;/Response/SearchCriteria/VAT_CODE&quot;/>
<xsl:choose>
<xsl:when test=&quot;ID=$SelectedItem&quot;>
<xsl:element name=&quot;option&quot;>
<xsl:attribute name=&quot;selected&quot;>selected</xsl:attribute>
<xsl:attribute name=&quot;value&quot;><xsl:value-of select=&quot;ID&quot;/></xsl:attribute>
<xsl:value-of select=&quot;Code&quot;/>
</xsl:element>
</xsl:when>
<xsl:eek:therwise>
<option>
<xsl:attribute name=&quot;value&quot;><xsl:value-of select=&quot;ID&quot;/></xsl:attribute>
<xsl:value-of select=&quot;//Code&quot;/>
</option>
</xsl:eek:therwise>
</xsl:choose>
</xsl:for-each>
</select>
</xsl:template>

And my section in .xml file looks like this :
<listdata>
<vatlist>
<Code>A001</Code>
<Code>A002</Code>
<Code>A003</Code>
</vatlist>

Can somebody tell me what's wrong with my combo box template function?

Thank you for advance!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top