[Home]  [List]  [News]  [Docs]  [FAQ]  [Downloads]  [Resources]  [About]
Search :
/Home /List

list4xt : Mailing list for the XT users community.

[list4xt] XT last() bug (fwd)

Subject: [list4xt] XT last() bug (fwd)

User: Website

From: Mike Brown (mike@skew.org)
Date: 31/10/2000 - 18:25


I am cleaning out my mailbox.
I didn't see this in the list4xt archives.

----- Forwarded message from Ron Ten-Hove -----

From: "Ron Ten-Hove" <rtenhove@forte.com>
To: <xsl-list@mulberrytech.com>
Cc: <david.hunter@mobileQ.COM>
Subject: RE: XT bug?
Date: Tue, 30 May 2000 14:54:43 -0700
Message-ID: <009e01bfca81$a9909500$3358dfcd@quake.forte.com>
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0
In-Reply-To: <11EFECB5ED98D111AC8E0060945138BC10C175@MAYTAG>
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
Importance: Normal
Precedence: bulk
Reply-To: xsl-list@mulberrytech.com
Content-Length: 1840

David,

It is a bug. In com.jclark.xsl.expr.FilterPattern, in the
getLastPosition() method, change line 64 from

        lastPosition = position;

to

        lastPosition = getPosition();

This problem appears whilst using the XSL last() function, in a use
case that causes the FilterPattern.getPosition() function not to be
called prior to getLastPosition().

-Ron

-----Original Message-----
From: owner-xsl-list@mulberrytech.com [mailto:owner-xsl-list@mulberrytech.com]On Behalf Of David Hunter
Sent: May 30, 2000 11:59
To: 'XSL-List@mulberrytech.com'
Subject: XT bug?

I just finished leaving the list, because I get too much email, and now I
have a question, and have to re-join. :-)

I have come across an inconsistency, between XT and Saxon/MSXML3 (the May
release of MSXML). I'm assuming that XT is incorrect, but I want to be
sure.

Suppose I have the following XML:

<nodes>
  <node>a</node>
  <node>b</node>
  <node>c</node>
</nodes>

I want to create a stylesheet which prints out only the value of the last
<node> element. So I have done this:

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>

<xsl:template match="/nodes/node[last()]">
  <xsl:value-of select="."/>
</xsl:template>

<xsl:template match="text()"/>
</xsl:stylesheet>

>From both Saxon and MSXML, I get "c" as my output, but from XT I get
nothing.

Is this an XT bug? Note that if I change the template match to
"/nodes/node[position() = last()]", it works the same in all three.

If this is a bug, I'll submit it on XT's web site, but if it's a
re-interpretation of the spec, I'll leave it.

David Hunter
MobileQ
david.hunter@mobileq.com
http://www.mobileq.com

 XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list

 XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list

----- End of forwarded message from Ron Ten-Hove -----

--
Mailing list for the XT users community.     (http://blogrolled.com)
(mailto:list4xt-request@4xt.org?Subject=unsubscribe to unsubscribe)



Archive générée par hypermail 2b28 le 25/04/2001 - 07:16 CEST

webmaster@4xt.org