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

xsl:for-each?

Subject: xsl:for-each?
From: "Kevin Duffey" <kevin.duffey@xxxxxxxx>
Date: Sun, 21 Jan 2001 10:58:59 -0800
 xsl:for-each?
Hi all,

I am having problems with the for-each. Basically, in the XML I have a node
below the "top" node (not root) in my xml. Its called markets:

<markets name="MarketName" id="MarketIDValue"/>
<markets name="MarketName2" id="MarketIDValue2"/>

In my xsl I first select the top node "ob" and that works fine..inside it,
in the <body> portion I have:

<xsl:apply-templates select="markets"/>

In the template I have:

  <xsl:template match="markets">
    <select name="Markets" size="1">
      <xsl:for-each select="markets">
        <option value="@id"/><xsl:value-of select="@name"/>
      </xsl:for-each>
    </select>
  </xsl:template>

Now, I know this isn't correct. I am confused as to why it doesn't work
though. If the xsl:apply-templates basically says "replace me with whatever
is in the xsl:template that matches my select attribute", then the for-each
should iterate through the markets? Or..is it because the xsl node is
already selected to "markets" that it is looking inside the first market
node it comes across and isn't finding anything called markets?

Thanks.


 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.