W3C home > Mailing lists > Public > public-qt-comments@w3.org > August 2010

[Bug 10425] New: [XSLT 2.1] snapshot() applied to attribute nodes

From: <bugzilla@jessica.w3.org>
Date: Wed, 25 Aug 2010 08:22:54 +0000
To: public-qt-comments@w3.org
Message-ID: <bug-10425-523@http.www.w3.org/Bugs/Public/>

           Summary: [XSLT 2.1] snapshot() applied to attribute nodes
           Product: XPath / XQuery / XSLT
           Version: Working drafts
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSLT 2.1
        AssignedTo: mike@saxonica.com
        ReportedBy: mike@saxonica.com
         QAContact: public-qt-comments@w3.org

The algorithm given in section 18.6 of the XSLT 2.1 WD to define the behaviour
of the snapshot() function is incorrect in the case where the supplied node is
an attribute or namespace node. The expression

<xsl:sequence select="$node/descendant-or-self::node()[$level]"/>

which terminates the recursion is assuming that the original node is a
descendant of the root, which is not the case if it is an attribute or

The fix for this isn't easy, because when the original node is an attribute or
namespace, all the attributes and namespaces of its parent element will be
copied, so the only way we can find the right one is by name. 

One solution might be to build a path to the node and then evaluate that path
using xsl:evaluate.

Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
Received on Wednesday, 25 August 2010 08:22:56 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:57:32 UTC