[xsl] XSLT 1.0 and XSLT 2.0 differences in position()?

Subject: [xsl] XSLT 1.0 and XSLT 2.0 differences in position()?
From: Alice Wei <ajwei@xxxxxxxxxxx>
Date: Wed, 12 Dec 2007 20:00:56 -0500
Hi,

I have made several attempts to turn my file from XSLT 1.0 to 2.0, but I have a strange question about the output. Are there supposed to be any differences in this function from 1.0 to 2.0?

In 1.0, my XSL segment:

<xsl:if test="position( ) !=last( )">, </xsl:if>
<xsl:if test="position( )=last()-1">and </xsl:if>

returns with a list of items separated by commas, and ends with and instead of a comma in between.

However, when I use the same XSL structure, but with the declaration of 2.0,
it returns with a list of items still separated by commas, but the last item on the list has a comma followed by an and.


eg. 1, 2, 3, 4 and 5 (XSLT 1.0)
   1, 2, 3, 4, and 5 (XSLT 2.0)

What must I do to get the XSLT 2.0 to have the same output as 1.0?
Thanks to those who can help.

Alice


Alice Wei MIS 2008 School of Library and Information Science Indiana University Bloomington

Current Thread