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

http://www.w3.org/Bugs/Public/show_bug.cgi?id=10425

           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
namespace.

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