xsl-list
[Top] [All Lists]

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

2007-12-12 18:01:28
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


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>