This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: For each loop faliure
- From: Jarno dot Elovirta at nokia dot com
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Fri, 5 Apr 2002 11:19:27 +0300
- Subject: RE: [xsl] For each loop faliure
- Reply-to: xsl-list at lists dot mulberrytech dot com
Correction,
> -----Original Message-----
> From: Elovirta Jarno (NBI/Espoo)
> Sent: 05. April 2002 11:08
> To: xsl-list@lists.mulberrytech.com
> Subject: RE: [xsl] For each loop faliure
>
>
> Heppa,
>
> > In the below code I want to for loop to be continued for all nodes.
> >
> > But here in this code below in the first case itself if the
> > condition fails
> > it goes out of for each loop.
> >
> > How about to proceed?
> >
> > <xsl:for-each select="$A/RecipeVersions">
> > <xsl:for-each select="$B/RecipeVersions">
> > <xsl:if
> > test="($A/RecipeVersions/RecipeVersion/VersionID !=
> > $B/RecipeVersions/RecipeVersion/VersionID) = false">
>
> this should be
>
> <xsl:if test="$A/RecipeVersions/RecipeVersion/VersionID =
> $B/RecipeVersions/RecipeVersion/VersionID">
It should be of course be
<xsl:for-each select="$A/RecipeVersions">
<xsl:variable name="outer-loop" select="." />
<xsl:for-each select="$B/RecipeVersions">
<xsl:if test="$outer-loop/RecipeVersion/VersionID = RecipeVersion/VersionID">
<xsl:value-of select="RecipeVersion/VersionID"/>
</xsl:if>
</xsl:for-each>
</xsl:for-each>
Santtu
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list