W3C home > Mailing lists > Public > public-qt-comments@w3.org > October 2014

[Bug 27119] New: [XQX31] unnecessary nesting in array constructors

From: <bugzilla@jessica.w3.org>
Date: Tue, 21 Oct 2014 05:49:15 +0000
To: public-qt-comments@w3.org
Message-ID: <bug-27119-523@http.www.w3.org/Bugs/Public/>
https://www.w3.org/Bugs/Public/show_bug.cgi?id=27119

            Bug ID: 27119
           Summary: [XQX31] unnecessary nesting in array constructors
           Product: XPath / XQuery / XSLT
           Version: Working drafts
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XQueryX 3.1
          Assignee: jim.melton@acm.org
          Reporter: jmdyck@ibiblio.org
        QA Contact: public-qt-comments@w3.org

The schema seems unnecessarily nested in the area of array constructors.

For instance, consider the query
    [1]
whose corresponding query in XQueryX 3.1 is:
    <xqx:module ...>
      <xqx:mainModule>
        <xqx:queryBody>
          <xqx:arrayConstructor>
            <xqx:squareArray>
              <xqx:arrayElem>
                <xqx:integerConstantExpr>
                  <xqx:value>1</xqx:value>
                </xqx:integerConstantExpr>
              </xqx:arrayElem>
            </xqx:squareArray>
          </xqx:arrayConstructor>
        </xqx:queryBody>
      </xqx:mainModule>
    </xqx:module>

(1)
here's no need for the <xqx:arrayConstructor> element. Its content can only
ever be a squareArray or a curlyArray, so it would be simpler to make *those*
be in the 'expr' substitution group. (And maybe rename them to
squareArrayConstructor and curlyArrayConstructor, to match the corresponding
non-terminals.)

The non-terminal ArrayConstructor doesn't need to be reflected in the schema at
all. (Consider that there is no xqx:constructor or xqx:nodeConstructor or
xqx:directConstructor or xqx:computedConstructor.)

(2)
There's no need for the <xqx:arrayElem> element. Its content can only ever be a
single expr, so it would be simpler to say that the content of a squareArray is
a sequence of exprs, and that the content of a curlyArray is an optional expr.
(Compare to exprList, sequenceExpr, and (roughly speaking)
exprOrPlaceholderList, each of which can contain an unbounded sequence of
exprs, without each being wrapped in another element.)

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
Received on Tuesday, 21 October 2014 05:49:17 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:57:49 UTC