This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Re: <xsl:for-each> problem ?


> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]