Thanks for these. (Are you doing conformance testing or something??)
 
On the first one, it's not actually an optimization bug, it's a bug in the test for node identity. It seems that "A is B" returns true if A is a non-namespace node and B is a namespace node that happens to have the same offset in its containing array that A has in its array. In this case they both have offset 1. The behavior is asymmetric because Element.isSameNode(B) is not the same code as Namespace.isSameNode(A).
 
The second one is a design error, it has been there since time immemorial. I probably misread the spec on the day that I implemented it. Not many people use generate-id() on attribute or namespace nodes!
 
Both bugs are also present in 6.5.3.
 
Michael Kay
-----Original Message-----
From: saxon-help-admin@lists.sourceforge.net [mailto:saxon-help-admin@lists.sourceforge.net] On Behalf Of Anton Lapounov
Sent: 11 September 2003 05:30
To: saxon-help@lists.sourceforge.net
Subject: [saxon] generate-id() bugs

Saxon 7.6.5

Problem description – please see XSL file.

 

XML file:

 

<doc xmlns:ns="some ns" ns:att="att value"/>

 

XSL file:

 

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

            <xsl:output method="text"/>

 

            <xsl:template match="doc">

                        <xsl:text>BUG 1 - wrong optimization causes different results being output</xsl:text>

                        [<xsl:value-of select="generate-id(.) = generate-id(namespace::*)"/>]

                        [<xsl:value-of select="generate-id(namespace::*) = generate-id(.)"/>]

 

                        <xsl:text>&#10;&#10;BUG 2 - colon (':') is not an alphanumeric character</xsl:text>

                        <xsl:value-of select="concat('&#10;id of att = ', generate-id(@*))"/>

            </xsl:template>

</xsl:stylesheet>

 

 

Thanks,

AntonL