This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: how to populate drop down list
- From: "Uslu, Cihan Y (MED)" <Cihan dot Uslu at med dot ge dot com>
- To: "'xsl-list at lists dot mulberrytech dot com'" <xsl-list at lists dot mulberrytech dot com>
- Date: Fri, 22 Mar 2002 13:43:31 -0600
- Subject: RE: [xsl] how to populate drop down list
- Reply-to: xsl-list at lists dot mulberrytech dot com
I want that list 5 times(there are 5 answers in XML snippet) to repeat,
so that I can choose the correct match attribute from drop down list for
each answer. That's why I was trying to use <xsl:for-each> to wrap the
<select> element. With the current code I get it only once.
This is how I want:
----------------------------------------------------------------
Drop-Down List( has all the match attributes in it) A. This is
Answer 1
Drop-Down List( has all the match attributes in it) B. This is
Answer 2
Drop-Down List( has all the match attributes in it) C. This is
Answer 3
Drop-Down List( has all the match attributes in it) D. This is
Answer 4
Drop-Down List( has all the match attributes in it) E. This is
Answer 5
---------------------------------------------------------------
-----Original Message-----
From: Oleg Tkachenko [mailto:olegt@multiconn.com]
Sent: Friday, March 22, 2002 12:38 PM
To: xsl-list@lists.mulberrytech.com
Subject: RE: [xsl] how to populate drop down list
Hello!
That's because you are creating select element for each answer element -
children of question.
Create only one and multiply options instead of select:
<select>
<xsl:for-each select="question/answer">
<option>
<xsl:value-of select="@match"/>
</option>
</xsl:for-each>
</select>
---
Oleg Tkachenko,
Multiconn International, Israel
> -----Original Message-----
> From: owner-xsl-list@lists.mulberrytech.com
> [mailto:owner-xsl-list@lists.mulberrytech.com]On Behalf Of Uslu,
> Cihan Y (MED)
> Sent: Friday, March 22, 2002 8:09 PM
> To: 'xsl-list@lists.mulberrytech.com'
> Subject: [xsl] how to populate drop down list
>
>
> Hi,
> How can I get drop down lists filled with all the match attributes for
> each answer element?
> I tried this xsl snippet, and I get same number of drop down list as
> number of answers but the list has only one @match attribute instead
of
> all the attributes.
>
>
> -----------
> <xsl:for-each select="./question/answer">
> <select>
> <xsl:for-each select="@match">
> <option>
> <xsl:value-of select="."/>
> </option>
> </xsl:for-each>
> </select>
> </xsl:for-each>
> ----------
>
> --------------
> <question>
> <stem>
> <para>Match each statement below with the best term.</para>
> </stem>
> <answer match="Systole" item-id="C">
> <para></para></answer>
> <answer match="Stenosis" item-id="D">
> <para></para></answer>
> <answer match="Collateral circulation" item-id="A">
> <para></para></answer>
> <answer match="Augmentation" item-id="E">
> <para></para></answer>
> <answer match="Arterial insufficiency" item-id="B">
> <para></para></answer>
> </question>
> ------------
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list