From: <[EMAIL PROTECTED]> on Thursday, September 20, 2001 10:40 PM
>
> Matt Robinson writes:
> >The problem stylesheet is Chapter5\crossref1.xsl, which when run against
> >the input terms.xml appears to go into an infinite loop. However, it
> >works fine with Xalan 1 and Saxon.
> >The problem seems to be centred around the following in the match for
> > <seealso>, specifically the last() function:
> > <xsl:if test="not(position()=last())">
> > <xsl:text>, </xsl:text>
> > </xsl:if>
>
> Our position11 test has this exact code sequence in it, so we would catch
> a breakage in our automated testing. Are you using a recent version of
> Xalan-J 2.x? Note also that infinite loops are exotic creatures in XSLT
> and your diagnostic thinking should steer away from such ideas.
I am using Xalan-J_2_2_D10 on W2K with Javasoft JRE 1.3.0_02, which I
downloaded today. The output I get when I terminate the process is as
follows:
See also: demilitarized zone, wildcard character, wildcard character,
wildcard character, wildcard character, wildcard character, wildcard
character, wildcard character, wildcard character, wildcard character,
wildcard character, wildcard character, wildcard character, wildcard
character, wildcard character, wildcard character, wildcard character,
wildcard character, wildcard character, wildcard character, wildcard
character, wildcard
and continues as such indefinitely. This to me resembles an infinite loop
:)
>
> I gather that you edited the stylesheet to remove just this part, and
> you got what you expected (the list without commas). If so, try this
> <xsl:value-of select="position()"/>
When I try this I get the correct index numbers displayed after the link:
See also: demilitarized zone1pattern-matching character2wildcard character3
> in place of the above three lines. If that gets a sequence of numbers
> instead of the commas, then try last() in place of position() and see
> if you get the highest number every time.
When I replace position() with last() I get an infinite loop which results
in output such as:
See also: demilitarized zone3wildcard character3wildcard character3wildcard
character3wildcard character3wildcard character3wildcard character3wildcard
character3wildcard character3wildcard character3wildcard character3wildcard
character3wildcard character3wildcard character3wildcard character3wildcard
All of these tests work correctly with Saxon and also Xalan 1.
> .................David Marston
Matt