W3C home > Mailing lists > Public > public-qt-comments@w3.org > June 2006

[Bug 3311] [XqueryX] Position of Setters in Prolog

From: <bugzilla@wiggum.w3.org>
Date: Mon, 05 Jun 2006 12:19:29 +0000
CC:
To: public-qt-comments@w3.org
Message-Id: <E1FnE3N-00046R-0V@wiggum.w3.org>

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

           Summary: [XqueryX]  Position of Setters in Prolog
           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


The XqueryX schema has the following structure (without the added comment)

  <xsd:element name="prolog">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:choice minOccurs="0" maxOccurs="unbounded">
          <xsd:element ref="defaultCollationDecl"/>
          <xsd:element ref="baseUriDecl"/>
          <xsd:element ref="constructionDecl"/>
          <xsd:element ref="orderingModeDecl"/>
          <xsd:element ref="emptyOrderingDecl"/>
          <xsd:element ref="copyNamespacesDecl"/>
<!--
        </xsd:choice>
        <xsd:choice minOccurs="0" maxOccurs="unbounded">
-->
          <xsd:element ref="defaultNamespaceDecl"/>
          <xsd:element ref="namespaceDecl"/>
          <xsd:element ref="schemaImport"/>
          <xsd:element ref="moduleImport"/>
        </xsd:choice>
        <xsd:choice minOccurs="0" maxOccurs="unbounded">
          <xsd:element ref="varDecl"/>
          <xsd:element ref="functionDecl"/>
          <xsd:element ref="optionDecl"/>
        </xsd:choice>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>

This forces (for example)
copyNamespacesDecl to come before defaultNamespaceDecl
and corresponds to some early drafts of the XQuery EBNF in which the "Setter"
Production was restricted to appearing earlier in the prolog.
In the current CR EBNF though ,the Setter production is merged in to the choice
group
((DefaultNamespaceDecl | Setter | NamespaceDecl | Import) Separator)*
so they may be mixed in any order.

Restricting the order in XQueryX (slightly) complicates an XQuery to XQueryX
translator as it needs to re-order the elements and (more seriously) it
complicates checking that round-tripping has worked, as expressions need to be
reordered.

Deleteting the two lines that are commented out in the above schena sample
would not invalidate any current XQueryX files and would simplify the
correspondence between XQuery and XQueryX.

Sorry this comment is late but it was triggered by Xquery Test Suite 0.9 which
has some examples of Prolog statements in orders not allowed by this schema.
(I ammended my translator to sort the expressions before writing out XQueryX 
so the latest version of xq2xqx does not need the change suggested here, but if
the change were made, I would remove the expression re-ordering from xq2xqx
which would simplify the round-trip testing.

David
Received on Monday, 5 June 2006 12:19:43 UTC

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