[Bug 2523] xqx: pathExpr and stepExpr

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

           Summary: xqx: pathExpr and stepExpr
           Product: XPath / XQuery / XSLT
           Version: Candidate Recommendation
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XQueryX
        AssignedTo: jim.melton@acm.org
        ReportedBy: davidc@nag.co.uk
         QAContact: public-qt-comments@w3.org


Xquery's PathExpr production is a very simple

[68] PathExpr ::=
  ("/" RelativePathExpr?)
| ("//" RelativePathExpr)
| RelativePathExpr

[69] RelativePathExpr ::=
  StepExpr (("/" | "//") StepExpr)*

so a sequence of steps, separated by / or //.

XqueryX on the other hand has a strange unexplained optional first child
   <xsd:sequence minOccurs="0">
            <xsd:element name="argExpr" type="exprWrapper"/>
            <xsd:element name="predicates" type="exprList" minOccurs="0"/>
          </xsd:sequence>

which doesn't seem to add anything, and complicates the schema and transforms to
and from XqueryX, Is there any reason not to delete this (or replace it by an
optional xqx:rootExpr), and bring XqueryX closer to the Xquery production?

Similarly XQueryX StepExpr is rather strange,with nameTest and Wildcard
appearing twice:

        <xsd:choice>
          <xsd:sequence>
            <xsd:element ref="xpathAxis"/>
            <xsd:choice>
              <xsd:element ref="kindTest"/>
              <xsd:element ref="nameTest"/>
              <xsd:element ref="Wildcard"/>
             </xsd:choice>
          </xsd:sequence>
          <xsd:element ref="nameTest"/>
          <xsd:element ref="Wildcard"/>

so in XqueryX if the step is a nameTest or WildCard the explict axis specifier
is optional (although in all the examples in the specification of name tests,
all but the last two, the child:: axis is made explict) However for kindtests
which the XQuery grammar treats identically to nameTests, XQueryX makes the axis
specifier mandatory. Why this inconsistency? I would propose that the last two
lines of the above schema extract are deleted, thus making the axis specifier
mandatory in XQueryX, this would be consistent with other treatment of
abbreviated XPath syntax such as //and @, forcing that it be expanded.

David

Received on Tuesday, 15 November 2005 01:21:07 UTC