W3C home > Mailing lists > Public > public-qt-comments@w3.org > December 2016

[Bug 30032] New: [xslt30] Static type of AXIS::node()

From: <bugzilla@jessica.w3.org>
Date: Sun, 11 Dec 2016 23:11:09 +0000
To: public-qt-comments@w3.org
Message-ID: <bug-30032-523@http.www.w3.org/Bugs/Public/>
https://www.w3.org/Bugs/Public/show_bug.cgi?id=30032

            Bug ID: 30032
           Summary: [xslt30] Static type of AXIS::node()
           Product: XPath / XQuery / XSLT
           Version: Candidate Recommendation
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSLT 3.0
          Assignee: mike@saxonica.com
          Reporter: mike@saxonica.com
        QA Contact: public-qt-comments@w3.org
  Target Milestone: ---

According to our current rules (ยง19.1) the static type of the expressions
attribute::node() and namespace::node() is U{node()} rather than U{attribute()}
or U{namespace-node()}, while the static type of child::node() is U{node()}
rather than U{element(), text(), comment(), processing-instruction()}. In
addition, typing of an expression such as self::node fails to take the context
item type into account.

This can be fixed by changing the rule

If the NodeTest is a KindTest K, then U{K} (for example, U{element()} or
U{comment()}). Otherwise (the NodeTest is a NameTest), the U-type corresponding
to the principal node kind of the axis, for example U{element()} or
U{attribute()}.

to:

The intersection of the UType corresponding to the node kinds that can be
reached via the specified axis, and the UType corresponding to the node kinds
that can be selected using the specified node test.

The node kinds reachable via a specified axis are as follows, where CIT is the
intersection of the context item type with U{N}:

  attribute - if CIT includes U{element()} then U{attribute()} else U{}
  namespace - if CIT includes U{element()} then U{namespace-node()} else U{}
  self - CIT
  child, descendant - if CIT includes U{element()} or U{document-node()} then
U{element(), text(), comment(), processing-instruction()} else U{}
  following-sibling,  preceding-sibling, following, or preceding - if CIT is
U{document-node()} then U{} else U{element(), text(), comment(),
processing-instruction()}
  parent, ancestor - if (CIT is U{document-node()} then U{} else U{element(),
document-node()}
  ancestor-or-self - the union of the node kinds reachable using the ancestor
axis and those reachable using the self axis
  decendant-or-self - the union of the node kinds reachable using the
descendant axis and those reachable using the self axis

The node kinds that can be selected using a given node test are:

* If the node-test is node(), then U{N}
* If the node-test is a specific node kind K, then the UType corresponding to
K.
* If the NodeTest is a NameTest, then the principal node kind of the specified
axis.

====

Examples of where this makes a difference:

* <xsl:value-of select="self::node()"/> becomes motionless rather than
consuming if the context item type is text().

*

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
Received on Sunday, 11 December 2016 23:11:12 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:58:03 UTC