Errata for XML Syntax for XQuery 1.0 (XQueryX)

31 March 2009

Latest version:
http://www.w3.org/XML/2007/qt-errata/XQueryX-errata.html
Editor:
Jim Melton, Oracle mailto:jim.melton@acm.org

Abstract

This document addresses errors in the XML Syntax for XQuery 1.0 (XQueryX) Recommendation published on 23 January 2007. It records all errors that, at the time of this document's publication, have solutions that have been approved by the XML Query Working Group. For updates see the latest version of that document.

The errata are numbered, and are listed in reverse chronological order of their date of origin. Each erratum is classified as Substantive, Editorial, or Markup. These categories are defined as follows:

Each entry contains the following information:

Colored boxes and shading are used to help distinguish new text from old, however these visual clues are not essential to an understanding of the change. The styling of old and new text is an approximation to its appearance in the published Recommendation, but is not normative. Hyperlinks are shown underlined in the erratum text, but the links are not live.

A number of indexes appear at the end of the document.

Substantive corrections are proposed by the XML Query Working Group (part of the XML Activity), where there is consensus that they are appropriate; they are not to be considered normative until approved by a Call for Review of Proposed Corrections or a Call for Review of an Edited Recommendation.

Please report errors in this document using W3C's public Bugzilla system (instructions can be found at http://www.w3.org/XML/2005/04/qt-bugzilla). If access to that system is not feasible, you may send your comments to the W3C XSLT/XPath/XQuery public comments mailing list, public-qt-comments@w3.org. It will be very helpful if you include the string [XQXerrata] in the subject line of your report, whether made in Bugzilla or in email. Each Bugzilla entry and email message should contain only one error report. Archives of the comments and responses are available at http://lists.w3.org/Archives/Public/public-qt-comments/.

Status of this Document

This is a public draft. None of the errata reported in this document have been approved by a Call for Review of Proposed Corrections or a Call for Review of an Edited Recommendation. As a consequence, they must not be considered to be normative.

The Working Group does not intend to progress these errata to normative status; instead, it intends to publish a second edition of the Recommendation incorporating these errata, and to progress the second edition to normative status.

Table of Contents

  Errata

     XQX.E6   The Introduction failed to specify that Notes are not normative.

     XQX.E5   The XSLT stylsheet in Appendix B contains a template for the transformation of <xqx:namespaceDeclaration> elements that fails to correctly "escape" curly braces in the same manner as does the template for the transformation of <xqx:attributeConstructor> elements.

     XQX.E4   The XQueryX Recommendation currently links to an obsolete version of the XQuery 1.0 grammar applet.

     XQX.E3   The XSLT stylesheet in Appendix B contains a template for the transformation of <xqx:parenthesizedExpr> elements that is unnecessary and the presence of which may be confusing.

     XQX.E2   The XQueryX solution to Example 4 incorrectly contains an <xqx:parenthesizedExpr> element.

     XQX.E1   The published XQueryX schema defines many elements using anonymous complex types.

  Indexes

    Index by affected section

    Index by Bugzilla entry

    Index by Schema

    Index by Example

    Index by Stylesheet

    Index by link

    Index by Introduction


XQX.E6 - editorial

See Bug 6377

Description

The Introduction failed to specify that Notes are not normative. A paragraph containing that statement has been inserted.

History

6 Jan 2009: Proposed

28 Jan 2009: Corrected

Change

In 1 Introduction (second paragraph):

Insert after the text:

XQueryX is an XML representation of an XQuery. It was created by mapping the productions of the XQuery grammar into XML productions. The result is not particularly convenient for humans to read and write, but it is easy for programs to parse, and because XQueryX is represented in XML, standard XML tools can be used to create, interpret, or modify queries.

The following:

In this document, examples and material labeled as "Note" are provided for explanatory purposes and are not normative.

XQX.E5 - substantive

See Bug 5343

Description

The XSLT stylsheet in Appendix B contains a template for the transformation of <xqx:namespaceDeclaration> elements that fails to correctly "escape" curly braces in the same manner as does the template for the transformation of <xqx:attributeConstructor> elements.

History

4 Jan 2008: Proposed

23 Jan 2008: Accepted

Change

In B Transforming XQueryX to XQuery:

Replace the following XSLT template:

  <xsl:template match="xqx:namespaceDeclaration">
    <xsl:text> xmlns</xsl:text>
    <xsl:if test="xqx:prefix">
      <xsl:text>:</xsl:text>
      <xsl:value-of select="xqx:prefix"/>
    </xsl:if>
    <xsl:value-of select="$EQUAL"/>
    <xsl:call-template name="quote">
      <xsl:with-param name="item" select="xqx:uri"/>
    </xsl:call-template>
  </xsl:template>

with:

  <xsl:template match="xqx:namespaceDeclaration">
    <xsl:text> xmlns</xsl:text>
    <xsl:if test="xqx:prefix">
      <xsl:text>:</xsl:text>
      <xsl:value-of select="xqx:prefix"/>
    </xsl:if>
    <xsl:value-of select="$EQUAL"/>
    <xsl:call-template name="quote">
       <xsl:with-param name="item">
         <xsl:call-template name="globalReplace">
           <xsl:with-param name="stringToBeFixed">
             <xsl:call-template name="globalReplace">
               <xsl:with-param name="stringToBeFixed">
                 <xsl:value-of select="xqx:uri"/>
               </xsl:with-param>
               <xsl:with-param name="toBeReplaced">
                 <xsl:text>{</xsl:text>
               </xsl:with-param>
               <xsl:with-param name="replacement">
                 <xsl:text>{{</xsl:text>
               </xsl:with-param>
             </xsl:call-template>
           </xsl:with-param>
           <xsl:with-param name="toBeReplaced">
             <xsl:text>}</xsl:text>
           </xsl:with-param>
           <xsl:with-param name="replacement">
             <xsl:text>}}</xsl:text>
           </xsl:with-param>
         </xsl:call-template>
       </xsl:with-param>
    </xsl:call-template>
  </xsl:template>

XQX.E4 - editorial

See Bug 5323

Description

The XQueryX Recommendation currently links to an obsolete version of the XQuery 1.0 grammar applet.

History

18 Dec 2007: Proposed

23 Jan 2008: Accepted

Change

In 3.1.4 Corresponding Grammar Abstract Parse Tree (first paragraph):

Replace the text:

For comparison, here is the abstract parse tree corresponding to the XQuery for Example 1, as produced by the XQuery grammar applets found at http://www.w3.org/2005/qt-applets/xqueryApplet.html.

With:

For comparison, here is the abstract parse tree corresponding to the XQuery for Example 1, as produced by the XQuery grammar applets found at http://www.w3.org/2007/01/applets/.

XQX.E3 - editorial

See Bug 4963

Description

The XSLT stylesheet in Appendix B contains a template for the transformation of <xqx:parenthesizedExpr> elements that is unnecessary and the presence of which may be confusing.

History

20 Aug 2007: Proposed

11 Sep 2007: Accepted

Change

In B Transforming XQueryX to XQuery:

Delete the following XSLT template:

  <xsl:template match="xqx:parenthesizedExpr">
    <xsl:value-of select="$LPAREN"/><xsl:apply-templates/><xsl:value-of select="$RPAREN"/>
  </xsl:template>

XQX.E2 - editorial

See Bug 4963

Description

The XQueryX solution to Example 4 incorrectly contains an <xqx:parenthesizedExpr> element. That element should instead be an <xqx:sequenceExpr> element.

History

20 Aug 2007: Proposed

11 Sep 2007: Accepted

Change

In 3.4.2 A Solution in XQueryX:

Replace the following XQueryX fragment:

                        <xqx:parenthesizedExpr>
                          <xqx:unionOp>
                            <xqx:firstOperand>
                              <xqx:pathExpr>
                                <xqx:stepExpr>
                                  <xqx:xpathAxis>child</xqx:xpathAxis>
                                  <xqx:nameTest xqx:prefix="ma">Seller</xqx:nameTest>
                                </xqx:stepExpr>
                              </xqx:pathExpr>
                            </xqx:firstOperand>
                            <xqx:secondOperand>
                              <xqx:pathExpr>
                                <xqx:stepExpr>
                                  <xqx:xpathAxis>child</xqx:xpathAxis>
                                  <xqx:nameTest xqx:prefix="ma">High_Bidder</xqx:nameTest>
                                </xqx:stepExpr>
                              </xqx:pathExpr>
                            </xqx:secondOperand>
                          </xqx:unionOp>
                        </xqx:parenthesizedExpr>

with:

                        <xqx:sequenceExpr>
                          <xqx:unionOp>
                            <xqx:firstOperand>
                              <xqx:pathExpr>
                                <xqx:stepExpr>
                                  <xqx:xpathAxis>child</xqx:xpathAxis>
                                  <xqx:nameTest xqx:prefix="ma">Seller</xqx:nameTest>
                                </xqx:stepExpr>
                              </xqx:pathExpr>
                            </xqx:firstOperand>
                            <xqx:secondOperand>
                              <xqx:pathExpr>
                                <xqx:stepExpr>
                                  <xqx:xpathAxis>child</xqx:xpathAxis>
                                  <xqx:nameTest xqx:prefix="ma">High_Bidder</xqx:nameTest>
                                </xqx:stepExpr>
                              </xqx:pathExpr>
                            </xqx:secondOperand>
                          </xqx:unionOp>
                        </xqx:sequenceExpr>

XQX.E1 - editorial

See Bug 4924

Description

The published XQueryX schema defines many elements using anonymous complex types. That makes it infeasible to extend the content model of those elements in other specifications that define XQueryX extensions corresponding perhaps to XQuery extensions. While conceptually simple, a number of changes are required to ensure that all elements are defined using named complex types.

History

14 Aug 2007: Proposed

15 Aug 2007: Accepted

Changes

  1. In 4 An XML Schema for the XQuery XML Syntax (the XML Schema):

    Replace the following element definition:

      <xsd:element name="pragma">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element name="pragmaName" type="QName"/>
            <xsd:element name="pragmaContents" type="xsd:string"/>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
    

    with:

      <xsd:complexType name="pragma">
        <xsd:sequence>
          <xsd:element name="pragmaName" type="QName"/>
          <xsd:element name="pragmaContents" type="xsd:string"/>
        </xsd:sequence>
      </xsd:complexType>
    
      <xsd:element name="pragma" type="pragma"/>
    
  2. Replace the following element definition:

      <xsd:element name="singleType">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element ref="atomicType"/>
            <xsd:element name="optional" type="emptyContent" minOccurs="0"/>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
    

    with:

      <xsd:complexType name="singleType">
        <xsd:sequence>
          <xsd:element ref="atomicType"/>
          <xsd:element name="optional" type="emptyContent" minOccurs="0"/>
        </xsd:sequence>
      </xsd:complexType>
    
      <xsd:element name="singleType" type="singleType"/>
    
  3. Replace the following element definition:

      <xsd:element name="typedVariableBinding">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element name="varName" type="QName"/>
            <xsd:element ref="typeDeclaration" minOccurs="0"/>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
    

    with:

      <xsd:complexType name="typedVariableBinding">
        <xsd:sequence>
          <xsd:element name="varName" type="QName"/>
          <xsd:element ref="typeDeclaration" minOccurs="0"/>
        </xsd:sequence>
      </xsd:complexType>
    
      <xsd:element name="typedVariableBinding" type="typedVariableBinding"/>
    
  4. Replace the following element definition:

      <xsd:element name="forClause">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element ref="forClauseItem" minOccurs="1" maxOccurs="unbounded"/>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
    

    with:

      <xsd:complexType name="forClause">
        <xsd:sequence>
          <xsd:element ref="forClauseItem" minOccurs="1" maxOccurs="unbounded"/>
        </xsd:sequence>
      </xsd:complexType>
    
      <xsd:element name="forClause" type="forClause"/>
    
  5. Replace the following element definition:

      <xsd:element name="letClauseItem">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:choice>
                      <xsd:sequence>
                <xsd:element ref="typedVariableBinding"/>
                            <xsd:element ref="forLetClauseItemExtensions" minOccurs="0" maxOccurs="unbounded"/>
                      </xsd:sequence>
              <xsd:element ref="forLetClauseItemExtensions" minOccurs="0" maxOccurs="unbounded"/>
                    </xsd:choice>
            <xsd:element name="letExpr" type="exprWrapper"/>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
    

    with:

      <xsd:complexType name="letClauseItem">
        <xsd:sequence>
          <xsd:choice>
            <xsd:sequence>
              <xsd:element ref="typedVariableBinding"/>
              <xsd:element ref="forLetClauseItemExtensions"
                           minOccurs="0" maxOccurs="unbounded"/>
            </xsd:sequence>
            <xsd:element ref="forLetClauseItemExtensions"
                         minOccurs="0" maxOccurs="unbounded"/>
          </xsd:choice>
          <xsd:element name="letExpr" type="exprWrapper"/>
        </xsd:sequence>
      </xsd:complexType>
    
      <xsd:element name="letClauseItem" type="letClauseItem"/>
    
  6. Replace the following element definition:

      <xsd:element name="letClause">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element ref="letClauseItem" maxOccurs="unbounded"/>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
    

    with:

      <xsd:complexType name="letClause">
        <xsd:sequence>
          <xsd:element ref="letClauseItem" maxOccurs="unbounded"/>
        </xsd:sequence>
      </xsd:complexType>
    
      <xsd:element name="letClause" type="letClause"/>
    
  7. Replace the following element definition:

      <xsd:element name="orderModifier">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element name="orderingKind" type="orderingKind" minOccurs="0"/>
            <xsd:element name="emptyOrderingMode" type="emptyOrderingMode" minOccurs="0"/>
            <xsd:element name="collation" type="xsd:string" minOccurs="0"/>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
    

    with:

      <xsd:complexType name="orderModifier">
        <xsd:sequence>
          <xsd:element name="orderingKind" type="orderingKind" minOccurs="0"/>
          <xsd:element name="emptyOrderingMode" type="emptyOrderingMode" minOccurs="0"/>
          <xsd:element name="collation" type="xsd:string" minOccurs="0"/>
        </xsd:sequence>
      </xsd:complexType>
    
      <xsd:element name="orderModifier" type="orderModifier"/>
    
  8. Replace the following element definition:

      <xsd:element name="orderBySpec">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element name="orderByExpr" type="exprWrapper"/>
            <xsd:element ref="orderModifier" minOccurs="0"/>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
    

    with:

      <xsd:complexType name="orderBySpec">
        <xsd:sequence>
          <xsd:element name="orderByExpr" type="exprWrapper"/>
          <xsd:element ref="orderModifier" minOccurs="0"/>
        </xsd:sequence>
      </xsd:complexType>
    
      <xsd:element name="orderBySpec" type="orderBySpec"/>
    
  9. Replace the following element definition:

      <xsd:element name="orderByClause">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element name="stable" type="emptyContent" minOccurs="0"/>
            <xsd:element ref="orderBySpec" maxOccurs="unbounded"/>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
    

    with:

      <xsd:complexType name="orderByClause">
        <xsd:sequence>
          <xsd:element name="stable" type="emptyContent" minOccurs="0"/>
          <xsd:element ref="orderBySpec" maxOccurs="unbounded"/>
        </xsd:sequence>
      </xsd:complexType>
    
      <xsd:element name="orderByClause" type="orderByClause"/>
    
  10. Replace the following element definition:

      <xsd:element name="quantifiedExprInClause">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element ref="typedVariableBinding"/>
            <xsd:element name="sourceExpr" type="exprWrapper"/>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
    

    with:

      <xsd:complexType name="quantifiedExprInClause">
        <xsd:sequence>
          <xsd:element ref="typedVariableBinding"/>
          <xsd:element name="sourceExpr" type="exprWrapper"/>
        </xsd:sequence>
      </xsd:complexType>
    
      <xsd:element name="quantifiedExprInClause" type="quantifiedExprInClause"/>
    
  11. Replace the following element definition:

      <xsd:element name="typeswitchExprCaseClause">
        <xsd:complexType>
          <xsd:complexContent>
            <xsd:extension base="expr">
              <xsd:sequence>
                <xsd:element ref="variableBinding" minOccurs="0"/>
                <xsd:element ref="sequenceType"/>
                <xsd:element name="resultExpr" type="exprWrapper"/>
              </xsd:sequence>
            </xsd:extension>
          </xsd:complexContent>
        </xsd:complexType>
      </xsd:element>
    

    with:

      <xsd:complexType name="typeswitchExprCaseClause">
        <xsd:complexContent>
          <xsd:extension base="expr">
            <xsd:sequence>
              <xsd:element ref="variableBinding" minOccurs="0"/>
              <xsd:element ref="sequenceType"/>
              <xsd:element name="resultExpr" type="exprWrapper"/>
            </xsd:sequence>
          </xsd:extension>
        </xsd:complexContent>
      </xsd:complexType>
    
      <xsd:element name="typeswitchExprCaseClause"
                   type="typeswitchExprCaseClause"/>
    
  12. Replace the following element definition:

      <xsd:element name="typeswitchExprDefaultClause">
        <xsd:complexType>
          <xsd:complexContent>
            <xsd:extension base="expr">
              <xsd:sequence>
                <xsd:element ref="variableBinding" minOccurs="0"/>
                <xsd:element name="resultExpr" type="exprWrapper"/>
              </xsd:sequence>
            </xsd:extension>
          </xsd:complexContent>
        </xsd:complexType>
      </xsd:element>
    

    with:

      <xsd:complexType name="typeswitchExprDefaultClause">
        <xsd:complexContent>
          <xsd:extension base="expr">
            <xsd:sequence>
              <xsd:element ref="variableBinding" minOccurs="0"/>
              <xsd:element name="resultExpr" type="exprWrapper"/>
            </xsd:sequence>
          </xsd:extension>
        </xsd:complexContent>
      </xsd:complexType>
    
      <xsd:element name="typeswitchExprDefaultClause"
                   type="typeswitchExprDefaultClause"/>
    
  13. Replace the following element definition:

      <xsd:element name="attributeList">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:choice maxOccurs="unbounded">
              <xsd:element name="attributeConstructor" type="attributeConstructor"/>
              <xsd:element name="namespaceDeclaration" type="namespaceDeclaration"/>
            </xsd:choice>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
    

    with:

      <xsd:complexType name="attributeList">
        <xsd:sequence>
          <xsd:choice maxOccurs="unbounded">
            <xsd:element name="attributeConstructor" type="attributeConstructor"/>
            <xsd:element name="namespaceDeclaration" type="namespaceDeclaration"/>
          </xsd:choice>
        </xsd:sequence>
      </xsd:complexType>
    
      <xsd:element name="attributeList" type="attributeList"/>
    
  14. Replace the following element definition:

      <xsd:element name="Wildcard">
        <xsd:complexType>
          <xsd:all>
            <xsd:element name="star" type="emptyContent" minOccurs="0"/>
            <xsd:element ref="NCName" minOccurs="0"/>
          </xsd:all>
        </xsd:complexType>
      </xsd:element>
    

    with:

      <xsd:complexType name="Wildcard">
        <xsd:all>
          <xsd:element name="star" type="emptyContent" minOccurs="0"/>
          <xsd:element ref="NCName" minOccurs="0"/>
        </xsd:all>
      </xsd:complexType>
    
      <xsd:element name="Wildcard" type="Wildcard"/>
    
  15. Replace the following element definition:

      <xsd:element name="attributeTest" substitutionGroup="kindTest">
        <xsd:complexType>
          <xsd:complexContent>
            <xsd:extension base="emptyItemTypeContent">
              <xsd:sequence minOccurs="0">
                <xsd:element name="attributeName" type="simpleWildcard"/>
                <xsd:element name="typeName" type="QName" minOccurs="0"/>
              </xsd:sequence>
            </xsd:extension>
          </xsd:complexContent>
        </xsd:complexType>
      </xsd:element>
    

    with:

      <xsd:complexType name="attributeTest">
        <xsd:complexContent>
          <xsd:extension base="emptyItemTypeContent">
            <xsd:sequence minOccurs="0">
              <xsd:element name="attributeName" type="simpleWildcard"/>
              <xsd:element name="typeName" type="QName" minOccurs="0"/>
            </xsd:sequence>
          </xsd:extension>
        </xsd:complexContent>
      </xsd:complexType>
    
      <xsd:element name="attributeTest" type="attributeTest"
                   substitutionGroup="kindTest"/>
    
  16. Replace the following element definition:

      <xsd:element name="elementTest" substitutionGroup="anyElementTest">
        <xsd:complexType>
          <xsd:complexContent>
            <xsd:extension base="emptyItemTypeContent">
              <xsd:sequence minOccurs="0">
                <xsd:element name="elementName" type="simpleWildcard"/>
                <xsd:sequence minOccurs="0">
                  <xsd:element name="typeName" type="QName"/>
                  <xsd:element name="nillable" type="emptyContent" minOccurs="0"/>
                </xsd:sequence>
              </xsd:sequence>
            </xsd:extension>
          </xsd:complexContent>
        </xsd:complexType>
      </xsd:element>
    

    with:

      <xsd:complexType name="elementTest">
        <xsd:complexContent>
          <xsd:extension base="emptyItemTypeContent">
            <xsd:sequence minOccurs="0">
              <xsd:element name="elementName" type="simpleWildcard"/>
              <xsd:sequence minOccurs="0">
                <xsd:element name="typeName" type="QName"/>
                <xsd:element name="nillable" type="emptyContent" minOccurs="0"/>
              </xsd:sequence>
            </xsd:sequence>
          </xsd:extension>
        </xsd:complexContent>
      </xsd:complexType>
    
      <xsd:element name="elementTest" type="elementTest"
                   substitutionGroup="anyElementTest"/>
    
  17. Replace the following element definition:

      <xsd:element name="documentTest" substitutionGroup="kindTest">
        <xsd:complexType>
          <xsd:complexContent>
            <xsd:extension base="emptyItemTypeContent">
              <xsd:sequence>
                 <xsd:element ref="anyElementTest" minOccurs="0"/>
              </xsd:sequence>
            </xsd:extension>
          </xsd:complexContent>
        </xsd:complexType>
      </xsd:element>
    

    with:

      <xsd:complexType name="documentTest">
        <xsd:complexContent>
          <xsd:extension base="emptyItemTypeContent">
            <xsd:sequence>
               <xsd:element ref="anyElementTest" minOccurs="0"/>
            </xsd:sequence>
          </xsd:extension>
        </xsd:complexContent>
      </xsd:complexType>
    
      <xsd:element name="documentTest" type="documentTest"
                   substitutionGroup="kindTest"/>
    
  18. Replace the following element definition:

      <xsd:element name="piTest" substitutionGroup="kindTest">
        <xsd:complexType>
          <xsd:complexContent>
            <xsd:extension base="emptyItemTypeContent">
              <xsd:sequence>
                <xsd:element name="piTarget" type="xsd:NCName" minOccurs="0"/>
              </xsd:sequence>
            </xsd:extension>
          </xsd:complexContent>
        </xsd:complexType>
      </xsd:element>
    

    with:

      <xsd:complexType name="piTest">
        <xsd:complexContent>
          <xsd:extension base="emptyItemTypeContent">
            <xsd:sequence>
              <xsd:element name="piTarget" type="xsd:NCName" minOccurs="0"/>
            </xsd:sequence>
          </xsd:extension>
        </xsd:complexContent>
      </xsd:complexType>
    
      <xsd:element name="piTest" type="piTest" substitutionGroup="kindTest"/>
    
  19. Replace the following element definition:

      <xsd:element name="xpathAxis">
        <xsd:simpleType>
          <xsd:restriction base="xsd:NMTOKEN">
            <xsd:enumeration value="child"/>
            <xsd:enumeration value="attribute"/>
            <xsd:enumeration value="self"/>
            <xsd:enumeration value="parent"/>
            <xsd:enumeration value="descendant-or-self"/>
            <xsd:enumeration value="descendant"/>
            <xsd:enumeration value="following"/>
            <xsd:enumeration value="following-sibling"/>
            <xsd:enumeration value="ancestor"/>
            <xsd:enumeration value="ancestor-or-self"/>
            <xsd:enumeration value="preceding"/>
            <xsd:enumeration value="preceding-sibling"/>
          </xsd:restriction>
        </xsd:simpleType>
      </xsd:element>
    

    with:

      <xsd:simpleType name="xpathAxis">
        <xsd:restriction base="xsd:NMTOKEN">
          <xsd:enumeration value="child"/>
          <xsd:enumeration value="attribute"/>
          <xsd:enumeration value="self"/>
          <xsd:enumeration value="parent"/>
          <xsd:enumeration value="descendant-or-self"/>
          <xsd:enumeration value="descendant"/>
          <xsd:enumeration value="following"/>
          <xsd:enumeration value="following-sibling"/>
          <xsd:enumeration value="ancestor"/>
          <xsd:enumeration value="ancestor-or-self"/>
          <xsd:enumeration value="preceding"/>
          <xsd:enumeration value="preceding-sibling"/>
        </xsd:restriction>
      </xsd:simpleType>
    
      <xsd:element name="xpathAxis" type="xpathAxis"/>
    
  20. Replace the following element definition:

      <xsd:element name="stepExpr">
        <xsd:complexType>
          <xsd:sequence>
            <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 name="filterExpr">
                <xsd:complexType>
                  <xsd:sequence>
                    <xsd:group ref="filterExpr"/>
                  </xsd:sequence>
                </xsd:complexType>
              </xsd:element>
            </xsd:choice>
            <xsd:element name="predicates" type="exprList" minOccurs="0"/>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
    

    with:

      <xsd:complexType name="stepExpr">
        <xsd:sequence>
          <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 name="filterExpr">
              <xsd:complexType>
                <xsd:sequence>
                  <xsd:group ref="filterExpr"/>
                </xsd:sequence>
              </xsd:complexType>
            </xsd:element>
          </xsd:choice>
          <xsd:element name="predicates" type="exprList" minOccurs="0"/>
        </xsd:sequence>
      </xsd:complexType>
    
      <xsd:element name="stepExpr" type="stepExpr"/>
    
  21. Replace the following element definition:

      <xsd:element name="module">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element ref="versionDecl" minOccurs="0"/>
            <xsd:choice>
              <xsd:element ref="mainModule"/>
              <xsd:element ref="libraryModule"/>
            </xsd:choice>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
    

    with:

      <xsd:complexType name="module">
        <xsd:sequence>
          <xsd:element ref="versionDecl" minOccurs="0"/>
          <xsd:choice>
            <xsd:element ref="mainModule"/>
            <xsd:element ref="libraryModule"/>
          </xsd:choice>
        </xsd:sequence>
      </xsd:complexType>
    
      <xsd:element name="module" type="module"/>
    
  22. Replace the following element definition:

      <xsd:element name="mainModule">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element ref="prolog" minOccurs="0"/>
            <xsd:element name="queryBody" type="exprWrapper"/>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
    

    with:

      <xsd:complexType name="mainModule">
        <xsd:sequence>
          <xsd:element ref="prolog" minOccurs="0"/>
          <xsd:element name="queryBody" type="exprWrapper"/>
        </xsd:sequence>
      </xsd:complexType>
    
      <xsd:element name="mainModule" type="mainModule"/>
    
  23. Replace the following element definition:

      <xsd:element name="libraryModule">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element ref="moduleDecl"/>
            <xsd:element ref="prolog" minOccurs="0"/>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
    

    with:

      <xsd:complexType name="libraryModule">
        <xsd:sequence>
          <xsd:element ref="moduleDecl"/>
          <xsd:element ref="prolog" minOccurs="0"/>
        </xsd:sequence>
      </xsd:complexType>
    
      <xsd:element name="libraryModule" type="libraryModule"/>
    
  24. Replace the following element definition:

      <xsd:element name="versionDecl">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element name="version" type="xsd:string"/>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
    

    with:

      <xsd:complexType name="versionDecl">
        <xsd:sequence>
          <xsd:element name="version" type="xsd:string"/>
        </xsd:sequence>
      </xsd:complexType>
    
      <xsd:element name="versionDecl" type="versionDecl"/>
    
  25. Replace the following element definition:

      <xsd:element name="prolog">
        <xsd:complexType>
          <xsd:sequence>
                <xsd:element ref="prologPartOneItem" minOccurs="0" maxOccurs="unbounded"/>
                <xsd:element ref="prologPartTwoItem" minOccurs="0" maxOccurs="unbounded"/>
              </xsd:sequence>
            </xsd:complexType>
      </xsd:element>
    

    with:

      <xsd:complexType name="prolog">
        <xsd:sequence>
    	    <xsd:element ref="prologPartOneItem" minOccurs="0" maxOccurs="unbounded"/>
    	    <xsd:element ref="prologPartTwoItem" minOccurs="0" maxOccurs="unbounded"/>
    	  </xsd:sequence>
    	</xsd:complexType>
    
      <xsd:element name="prolog" type="prolog"/>
    
  26. Replace the following element definition:

      <xsd:element name="constructionDecl" substitutionGroup="prologPartOneItem">
        <xsd:simpleType>
          <xsd:restriction base="xsd:NMTOKEN">
            <xsd:enumeration value="strip"/>
            <xsd:enumeration value="preserve"/>
          </xsd:restriction>
        </xsd:simpleType>
      </xsd:element>
    

    with:

      <xsd:simpleType name="constructionDecl">
        <xsd:restriction base="xsd:NMTOKEN">
          <xsd:enumeration value="strip"/>
          <xsd:enumeration value="preserve"/>
        </xsd:restriction>
      </xsd:simpleType>
    
      <xsd:element name="constructionDecl" type="constructionDecl"
                   substitutionGroup="prologPartOneItem"/>
    
  27. Replace the following element definition:

      <xsd:element name="orderingModeDecl" substitutionGroup="prologPartOneItem">
        <xsd:simpleType>
          <xsd:restriction base="xsd:NMTOKEN">
            <xsd:enumeration value="ordered"/>
            <xsd:enumeration value="unordered"/>
          </xsd:restriction>
        </xsd:simpleType>
      </xsd:element>
    

    with:

      <xsd:simpleType name="orderingModeDecl">
        <xsd:restriction base="xsd:NMTOKEN">
          <xsd:enumeration value="ordered"/>
          <xsd:enumeration value="unordered"/>
        </xsd:restriction>
      </xsd:simpleType>
    
      <xsd:element name="orderingModeDecl" type="orderingModeDecl"
                   substitutionGroup="prologPartOneItem"/>
    
  28. Replace the following element definition:

      <xsd:element name="copyNamespacesDecl" substitutionGroup="prologPartOneItem">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element name="preserveMode">
              <xsd:simpleType>
                <xsd:restriction base="xsd:NMTOKEN">
                  <xsd:enumeration value="preserve"/>
                  <xsd:enumeration value="no-preserve"/>
                </xsd:restriction>
              </xsd:simpleType>
            </xsd:element>
            <xsd:element name="inheritMode">
              <xsd:simpleType>
                <xsd:restriction base="xsd:NMTOKEN">
                  <xsd:enumeration value="inherit"/>
                  <xsd:enumeration value="no-inherit"/>
                </xsd:restriction>
              </xsd:simpleType>
            </xsd:element>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
    

    with:

      <xsd:complexType name="copyNamespacesDecl">
        <xsd:sequence>
          <xsd:element name="preserveMode">
            <xsd:simpleType>
              <xsd:restriction base="xsd:NMTOKEN">
                <xsd:enumeration value="preserve"/>
                <xsd:enumeration value="no-preserve"/>
              </xsd:restriction>
            </xsd:simpleType>
          </xsd:element>
          <xsd:element name="inheritMode">
            <xsd:simpleType>
              <xsd:restriction base="xsd:NMTOKEN">
                <xsd:enumeration value="inherit"/>
                <xsd:enumeration value="no-inherit"/>
              </xsd:restriction>
            </xsd:simpleType>
          </xsd:element>
        </xsd:sequence>
      </xsd:complexType>
    
      <xsd:element name="copyNamespacesDecl" type="copyNamespacesDecl"
                   substitutionGroup="prologPartOneItem"/>
    
  29. Replace the following element definition:

      <xsd:element name="defaultNamespaceDecl" substitutionGroup="prologPartOneItem">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element name="defaultNamespaceCategory" type="defaultNamespaceCategory"/>
            <xsd:element name="uri" type="xsd:string"/>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
    

    with:

      <xsd:complexType name="defaultNamespaceDecl">
        <xsd:sequence>
          <xsd:element name="defaultNamespaceCategory" type="defaultNamespaceCategory"/>
          <xsd:element name="uri" type="xsd:string"/>
        </xsd:sequence>
      </xsd:complexType>
    
      <xsd:element name="defaultNamespaceDecl" type="defaultNamespaceDecl"
                   substitutionGroup="prologPartOneItem"/>
    
  30. Replace the following element definition:

      <xsd:element name="schemaImport" substitutionGroup="prologPartOneItem">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:choice minOccurs="0">
              <xsd:element name="namespacePrefix" type="xsd:NCName"/>
              <xsd:element name="defaultElementNamespace" type="emptyContent"/>
            </xsd:choice>
            <xsd:element name="targetNamespace" type="xsd:string"/>
            <xsd:element name="targetLocation" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
    

    with:

      <xsd:complexType name="schemaImport">
        <xsd:sequence>
          <xsd:choice minOccurs="0">
            <xsd:element name="namespacePrefix" type="xsd:NCName"/>
            <xsd:element name="defaultElementNamespace" type="emptyContent"/>
          </xsd:choice>
          <xsd:element name="targetNamespace" type="xsd:string"/>
          <xsd:element name="targetLocation" type="xsd:string"
                       minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
      </xsd:complexType>
    
      <xsd:element name="schemaImport" type="schemaImport"
                   substitutionGroup="prologPartOneItem"/>
    
  31. Replace the following element definition:

      <xsd:element name="moduleImport" substitutionGroup="prologPartOneItem">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element name="namespacePrefix" type="xsd:NCName" minOccurs="0"/>
            <xsd:element name="targetNamespace" type="xsd:string"/>
            <xsd:element name="targetLocation" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
    

    with:

      <xsd:complexType name="moduleImport">
        <xsd:sequence>
          <xsd:element name="namespacePrefix" type="xsd:NCName" minOccurs="0"/>
          <xsd:element name="targetNamespace" type="xsd:string"/>
          <xsd:element name="targetLocation" type="xsd:string"
                       minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
      </xsd:complexType>
    
      <xsd:element name="moduleImport" type="moduleImport"
                   substitutionGroup="prologPartOneItem"/>
    
  32. Replace the following element definition:

      <xsd:element name="varDecl" substitutionGroup="prologPartTwoItem">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element name="varName" type="QName"/>
            <xsd:element ref="typeDeclaration" minOccurs="0"/>
            <xsd:choice>
              <xsd:element name="varValue" type="exprWrapper"/>
              <xsd:element name="external" type="emptyContent"/>
            </xsd:choice>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
    

    with:

      <xsd:complexType name="varDecl">
        <xsd:sequence>
          <xsd:element name="varName" type="QName"/>
          <xsd:element ref="typeDeclaration" minOccurs="0"/>
          <xsd:choice>
            <xsd:element name="varValue" type="exprWrapper"/>
            <xsd:element name="external" type="emptyContent"/>
          </xsd:choice>
        </xsd:sequence>
      </xsd:complexType>
    
      <xsd:element name="varDecl" type="varDecl"
                   substitutionGroup="prologPartTwoItem"/>
    
  33. Replace the following element definition:

      <xsd:element name="optionDecl" substitutionGroup="prologPartTwoItem">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element name="optionName" type="QName"/>
            <xsd:element name="optionContents" type="xsd:string"/>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
    

    with:

      <xsd:complexType name="optionDecl">
        <xsd:sequence>
          <xsd:element name="optionName" type="QName"/>
          <xsd:element name="optionContents" type="xsd:string"/>
        </xsd:sequence>
      </xsd:complexType>
    
      <xsd:element name="optionDecl" type="optionDecl"
                   substitutionGroup="prologPartTwoItem"/>
    
  34. Replace the following element definition:

      <xsd:element name="functionDecl" substitutionGroup="prologPartTwoItem">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element name="functionName" type="QName"/>
            <xsd:element ref="paramList"/>
            <xsd:element ref="typeDeclaration" minOccurs="0"/>
            <xsd:choice>
              <xsd:element name="functionBody" type="exprWrapper"/>
              <xsd:element name="externalDefinition" type="emptyContent"/>
            </xsd:choice>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
    

    with:

      <xsd:complexType name="functionDecl">
        <xsd:sequence>
          <xsd:element name="functionName" type="QName"/>
          <xsd:element ref="paramList"/>
          <xsd:element ref="typeDeclaration" minOccurs="0"/>
          <xsd:choice>
            <xsd:element name="functionBody" type="exprWrapper"/>
            <xsd:element name="externalDefinition" type="emptyContent"/>
          </xsd:choice>
        </xsd:sequence>
      </xsd:complexType>
    
      <xsd:element name="functionDecl" type="functionDecl"
                   substitutionGroup="prologPartTwoItem"/>
    
  35. Replace the following element definition:

      <xsd:element name="param">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element name="varName" type="QName"/>
            <xsd:element ref="typeDeclaration" minOccurs="0"/>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
    

    with:

      <xsd:complexType name="param">
        <xsd:sequence>
          <xsd:element name="varName" type="QName"/>
          <xsd:element ref="typeDeclaration" minOccurs="0"/>
        </xsd:sequence>
      </xsd:complexType>
    
      <xsd:element name="param" type="param"/>
    
  36. Replace the following element definition:

      <xsd:element name="paramList">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element ref="param" minOccurs="0" maxOccurs="unbounded"/>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
    

    with:

      <xsd:complexType name="paramList">
        <xsd:sequence>
          <xsd:element ref="param" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
      </xsd:complexType>
    
      <xsd:element name="paramList" type="paramList"/>
    

Index by affected section

1 Introduction

XQX.E6

3.1.4 Corresponding Grammar Abstract Parse Tree

XQX.E4

Index by Bugzilla entry

Bug #4924: XQX.E1

Bug #4963: XQX.E2 XQX.E3

Bug #5323: XQX.E4

Bug #5343: XQX.E5

Bug #6377: XQX.E6

Index by Schema

xqueryx.xsd: XQX.E1

Index by Example

Example 4, XQueryX solution: XQX.E2

Index by Stylesheet

xqueryx.xsl: XQX.E3 XQX.E5

Index by link

XQuery grammar applet: XQX.E4

Index by Introduction

xqueryx.xml: XQX.E6