[xsl] xsl:for-each?

Subject: [xsl] xsl:for-each?
From: "Kevin Duffey" <kevin.duffey@xxxxxxxx>
Date: Sun, 21 Jan 2001 10:58:59 -0800
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"/>

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?


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

Current Thread