[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|