This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 3311 - [XqueryX] Position of Setters in Prolog
Summary: [XqueryX] Position of Setters in Prolog
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XQueryX 1.0 (show other bugs)
Version: Candidate Recommendation
Hardware: PC Windows XP
: P2 normal
Target Milestone: ---
Assignee: Jim Melton
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-06-05 12:19 UTC by David Carlisle
Modified: 2006-06-13 22:47 UTC (History)
0 users

See Also:


Attachments
XML Schema for XQueryX (40.14 KB, application/xml)
2006-06-13 17:57 UTC, Jim Melton
Details
XSLT stylesheet for XQueryX (38.97 KB, application/xml)
2006-06-13 17:58 UTC, Jim Melton
Details

Description David Carlisle 2006-06-05 12:19:28 UTC
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
Comment 1 Jim Melton 2006-06-05 23:20:10 UTC
Thanks for your comment.  I agree with the comment and proposed solution, and will propose to the XML Query WG that it be adopted. 
Comment 2 Jim Melton 2006-06-13 17:57:41 UTC
Created attachment 432 [details]
XML Schema for XQueryX

This attachment contains the XML Schema that defines XQueryX, current with all Bugzilla bug solutions implemented as of 2006-06-13.
Comment 3 Jim Melton 2006-06-13 17:58:09 UTC
Created attachment 433 [details]
XSLT stylesheet for XQueryX

This attachment contains the XSLT Stylesheet that defines the semantics of XQueryX by transforming it to XQuery, current with all Bugzilla bug solutions implemented as of 2006-06-13.
Comment 4 Jim Melton 2006-06-13 17:58:53 UTC
Thanks for your ongoing interest in this issue and for your proposed solution.  The XML Query WG agreed with that solution and has approved its inclusion into the XQueryX specification.  Since we have adopted your solution, we assume that your concerns are satisfied.  I have marked this bug FIXED and request that you mark it CLOSED at your earliest convenience. 

In the interests of ensuring that the entire community has access to the most current version of the XQueryX schema and stylesheet, I am attaching both of those as responses to this bug. 
Comment 5 David Carlisle 2006-06-13 22:47:07 UTC
looks fine thanks, I've reverted xq2xqx not to need the re-ordering and everything seems fine with the new schema.