This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Re: <xsl:for-each> problem ?
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] Re: <xsl:for-each> problem ?
- From: "Michael Kay" <mhkay at iclway dot co dot uk>
- Date: Mon, 23 Jul 2001 10:12:40 +0100
- Reply-To: xsl-list at lists dot mulberrytech dot com
> Hi, my xsl does not generate the right html output. The problem
> seems to be <xsl:for-each>. Instead of the two stocks for each
> date, I get all four stocks for each date (conflicts with how
> data is in my xml file).
>
> <xsl:for-each select="FTSE100/DATE">
...
> <xsl:for-each select="/FTSE100/DATE/STOCK">
..
The inner for-each is selecting every /FTSE100/DATE/STOCK in the source
document. You want to select the STOCK elements that are children of the
outer DATE element. Change it to
<xsl:for-each select="STOCK">
Mike Kay
Software AG
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list