This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
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(). *
The changes were agreed and have been applied.