On the face of it, this certainly looks like a bug (in variable inlining). Could you supply a repro please?


Michael Kay

From: Mark Gabriel [mailto:mgabriel@limehousesoftware.co.uk]
Sent: 12 August 2009 17:13
To: saxon-help@lists.sourceforge.net
Subject: [saxon] Lazy evaluation of variable with scope problem. Bug?

Hi all,


I’m using Saxon on the command line and trying to debug and profile some code from within out application and I’ve found this:


<xsl:variable name="autoNumberKey" select="string(@lhs:autoNumberKey)"/>

<xsl:number count="*[@lhs:autoNumberKey = $autoNumberKey]" from="document" level="any" format="1”/>


Seems to produce a different result to:


<xsl:variable name="autoNumberKey" select="string(@lhs:autoNumberKey)"/>

<xsl:message select="$autoNumberKey"/>

<xsl:number count="*[@lhs:autoNumberKey = $autoNumberKey]" from="document" level="any" format="1”/>


Should this really be happening??


How can I code around this to count all elements with the same @lhs:autoNumberKey value as the current node?





Mark Gabriel

Limehouse Software Ltd

DDI:  01628 640 452
Main: 01628 640 401        
Fax:  01628 640 461         

Limehouse Software Limited
St Cloud Gate
St Cloud Way
Cookham Road
Maidenhead, Berks

www.limehousesoftware.co.uk - Unifying Information

Limehouse Software Limited - An Objective
The information contained in this e-mail or in any attachments is confidential and is intended solely for the named addressee only. Access to this e-mail by anyone else is unauthorised. If you are not the intended recipient, please notify Limehouse Software Ltd immediately by returning this e-mail to sender or calling 01628 640 401 and do not read, use or disseminate the information. Opinions expressed in this e-mail are those of the sender and not necessarily the company. Although an active anti-virus policy is operated, the company accepts no liability for any damage caused by any virus transmitted by this e-mail, including any attachments.