[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: adding unique values to a drop-down list

Subject: RE: adding unique values to a drop-down list
From: "kfricovsky" <kfricovsky@xxxxxxxxxxx>
Date: Tue, 4 Dec 2001 12:18:19 -0500
xsl value of select
This will work for you. I used <funds> as my root element.

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method="html"/>
	<xsl:template match="fund">
	<form action="">
		<select name="FOO">
		<xsl:for-each select="Loan[not(.=preceding-sibling::*)
and string(BrokerSet/Broker/Name) and string(BrokerSet/Broker/Name)]">
			<option
value="{BrokerSet/Broker/Id}"><xsl:value-of
select="BrokerSet/Broker/Name" /> - <xsl:value-of
select="BrokerSet/Broker/Id" /></option>
		</xsl:for-each>
		</select>
	</form>
	</xsl:template>
</xsl:stylesheet>

-Kevin Fricovsky


-----Original Message-----
From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Katie
McNally
Sent: Tuesday, December 04, 2001 11:45 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject:  adding unique values to a drop-down list


I have xml that contains loans and their data (which includes broker
name 
and id).

I need to add a drop-down of brokers to my page.  Each selection in the
list 
box needs to display "Broker Name - Broker Id" and the value of each 
selection must be set to the Broker Id.  These selections must be listed

alphabetically, with only unique values displayed (no duplicates).

For example:

Example XML:

<Loan>
  <BrokerSet>
    <Broker>
      <Name>ABC Broker</Name>
      <Id>123456</Id>
    </Broker>
  </BrokerSet>
</Loan>
<Loan>
  <BrokerSet>
    <Broker>
      <Name>LMN Broker</Name>
      <Id>345678</Id>
    </Broker>
  </BrokerSet>
</Loan>
<Loan>
  <BrokerSet>
    <Broker>
      <Name/>
      <Id/>
    </Broker>
  </BrokerSet>
</Loan>
<Loan>
  <BrokerSet>
    <Broker>
      <Name>LMN Broker</Name>
      <Id>345678</Id>
    </Broker>
  </BrokerSet>
</Loan>
<Loan>
  <BrokerSet>
    <Broker>
      <Name>ABC Broker</Name>
      <Id>999999</Id>
    </Broker>
  </BrokerSet>
</Loan>

For the xml listed above, the list box should contain the following
values: All Brokers ABC Broker - 123456 ABC Broker - 999999 LMN Broker -
345678

How do I fill the list box with only unique selections which consist of 
broker name/broker id combinations?
How do I handle loans that do not have broker name or id data?

Thanks,
Katie



_________________________________________________________________
Get your FREE download of MSN Explorer at
http://explorer.msn.com/intl.asp


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.