This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
In the version found at http://www.w3.org/TR/xpath20/#id-path-expressions The statements which indicate to sometimes abbreviate / as fn:root(self::node()) treat as document-node()/ and // as fn:root(self::node()) treat as document-node()/descendant-or-self::node() are not syntactically correct. My own parser, as well as the parser at http://www.w3.org/2006/11/applets/xpathApplet.html refuse to parse such input. The Formal Semantics http://www.w3.org/TR/xquery-semantics/#id-path-expressions indicate a parenthesized version of the same construct. Are the Formal Semantics are correct and XPath needs to be corrected?
Personal response: Yes, I think you're right. fn:root(self::node()) treat as document-node()/X does not parse because the expression on the lhs of "/" must be a StepExpr, and a TreatExpr is not a StepExpr. It needs to be parenthesized.
On July 31, 2007, the Query and XSLT working groups agreed to add parentheses to the expansions of leading-/ and leading-// in path expressions, as suggested by this bug report. The revised expansions will appear in a future errata document. Regards, Don Chamberlin (for the joint working groups)
The agreed change will be published in Erratum XP.E3 for XPath, XQ.E3 for XQuery.