[Bug 1861] New: [Xquery] Text node constructors: parent property

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

           Summary: [Xquery] Text node constructors: parent property
           Product: XPath / XQuery / XSLT
           Version: Last Call drafts
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XQuery
        AssignedTo: chamberl@almaden.ibm.com
        ReportedBy: mike@saxonica.com
         QAContact: public-qt-comments@w3.org


Section 3.7.3.4 says

The parent property of the text node is the node constructed by the nearest
containing element or document node constructor, either direct or computed, if
such a constructor exists; otherwise parent is empty.

This seems quite wrong. Consider

document{
  let $x := text{"fred"}
  return count($x/..)
}

The "nearest containing document constructor" is irrelevant here. This returns zero.

As with other constructors, the new node initially has no parent; evaluating the
document{} constructor makes a copy of the text node that does have a parent.

Michael Kay

Received on Friday, 19 August 2005 15:58:22 UTC