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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

Bugzilla from bugzilla@jessica.w3.org
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: [hidden email]
          Reporter: [hidden email]
        QA Contact: [hidden email]

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.

Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

Bugzilla from bugzilla@jessica.w3.org
https://www.w3.org/Bugs/Public/show_bug.cgi?id=27119

C. M. Sperberg-McQueen <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |[hidden email]
         Resolution|---                         |WORKSFORME

--- Comment #1 from C. M. Sperberg-McQueen <[hidden email]> ---
The WG considered this issue in the face to face meeting today.  There was some
sentiment on each side of the question, but in the end the prevailing view was
that the change proposed here should not be made.  In general, an XML
serialization of a context-free grammar can be designed to be as light-weight
as is consistent with clarity, or to match the grammar as closely as possible,
with each non-terminal turning into an element type.  While XQueryX is not
absolutely consistent in this regard, the general design approach is toward
close alignment with the grammar.  

Accordingly, I have been asked to close the issue as WORKSFORME.

--
You are receiving this mail because:
You are the QA Contact for the bug.

Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

Bugzilla from bugzilla@jessica.w3.org
In reply to this post by Bugzilla from bugzilla@jessica.w3.org
https://www.w3.org/Bugs/Public/show_bug.cgi?id=27119

--- Comment #2 from Michael Dyck <[hidden email]> ---
(In reply to C. M. Sperberg-McQueen from comment #1)
> The WG considered this issue in the face to face meeting today.  There was
> some sentiment on each side of the question,

That surprises me. In my original post, I gave supporting examples of how the
XQueryX schema has handled analogous situations in the past. Did the sentiment
on the other side of the question provide any reasoning for treating these new
cases differently?

> In general, an
> XML serialization of a context-free grammar can be designed to be as
> light-weight as is consistent with clarity, or to match the grammar as
> closely as possible, with each non-terminal turning into an element type.

Agreed.

> While XQueryX is not absolutely consistent in this regard, the general
> design approach is toward close alignment with the grammar.

If "close alignment with the grammar" is meant to refer to the second approach
described in the previous sentence, then I disagree that that's the general
approach used by XQueryX. I think it's actually closer to the first approach.
Can anyone give examples (aside from the constructs in question) of how it's
*not* "as light-weight as is consistent with clarity"? Because I can certainly
give lots of examples where it *doesn't* turn each non-terminal into an element
type.

--
You are receiving this mail because:
You are the QA Contact for the bug.

Loading...