Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ComboBox in XSL?

0 views
Skip to first unread message

Jodok Schaeffler

unread,
Dec 5, 2001, 3:42:59 AM12/5/01
to
Hello,

is it possible, by using XSL, to let the user choose with a ComboBox which
detail of
an XML file he wants to see? I have seen examples how a ComboBox can be
inserted into an XSL file, but could not figure out how the selection of the
ComboBox
can be used to show the corresponding information.

Example:

XML File, showing inflation values for different currencies:

<CPI Cur="USD">
<Path Number="1" Value="0.0338, 0.0131, 0.0162, 0.0123" />
<Path Number="2" Value="0.0338, 0.0131, 0.0162, 0.0123" />
<Path Number="3" Value="0.0338, 0.0131, 0.0162, 0.0123" />
</CPI>
<CPI Cur="GBP">
<Path Number="1" Value="0.0438, 0.0331, 0.0262, 0.0523" />
<Path Number="2" Value="0.0438, 0.0331, 0.0262, 0.0523" />
<Path Number="3" Value="0.0438, 0.0331, 0.0262, 0.0523" />
</CPI>
<CPI Cur="EUR">
<Path Number="1" Value="0.0538, 0.0431, 0.0262, 0.0323" />
<Path Number="2" Value="0.0538, 0.0431, 0.0262, 0.0323" />
<Path Number="3" Value="0.0538, 0.0431, 0.0262, 0.0323" />
</CPI>


What I would like to get is a ComboBox that allows the user to choose
the currency, and then display the different values for this one currency:

Currency: <ComboBox>EUR

Path Value
1 0.0338, 0.0131, 0.0162, 0.0123
2 0.0338, 0.0131, 0.0162, 0.0123
3 0.0338, 0.0131, 0.0162, 0.0123


==================================================


With best regards

Jodok Schaeffler

Mr Underhill

unread,
Dec 7, 2001, 7:49:29 AM12/7/01
to
Try the following type of function in your XSL:


<table>
<tr>
<th width="30%">
Supplier:
</th>
<td>
<xsl:call-template
name="Suppliers">
<xsl:with-
param name="SupplierID">

<xsl:value-of select="z:row/@SupplierID" />
</xsl:with-
param>
</xsl:call-
template>
</td>
</tr>
</table>

<xsl:template name="FeedGroups">
<xsl:param name="FeedGroupID" />
<Select id="cbr_FeedGroupID"
name="cbr_FeedGroupID" class="AdapterTextBox">
<option value="" />
<xsl:for-each
select="//FeedGroups/xml/rs:data/z:row">
<option>
<xsl:attribute
name="value">
<xsl:value-of
select="@FeedGroupID" />
</xsl:attribute>
<xsl:if
test="@FeedGroupID=$FeedGroupID">
<xsl:attribute
name="selected" />
</xsl:if>
<xsl:value-of
select="@FeedGroupName" />
<xsl:call-template
name="GetAttributes">
<xsl:with-param
name="Field">FeedGroupID</xsl:with-param>
</xsl:call-template>
</option>
</xsl:for-each>
</Select>
</xsl:template>

>.
>

0 new messages