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 3022 - [XQueryX] transform of empty <xqx:Wildcard>
Summary: [XQueryX] transform of empty <xqx:Wildcard>
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-03-20 18:24 UTC by Andrew Eisenberg
Modified: 2006-07-29 00:02 UTC (History)
0 users

See Also:


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

Description Andrew Eisenberg 2006-03-20 18:24:47 UTC
The XQueryX schema allows the use of empty <xqx:Wildcard> elements:

  <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>

The XQueryX stylesheet, however, generates nothing for this empty element:

  <xsl:template match="xqx:Wildcard">
    <xsl:apply-templates select="*[1]"/>
    <xsl:if test="*[2]">
      <xsl:value-of select="$COLON"/>
      <xsl:apply-templates select="*[2]"/>
    </xsl:if>
  </xsl:template>

This seems problematic, as stepExpr can be a an xpathAxis followed by Wildcard:

  <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:choice>
        <xsd:element name="predicates" type="exprList" minOccurs="0"/>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>
Comment 1 Jim Melton 2006-06-13 17:51:54 UTC
Created attachment 430 [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 2 Jim Melton 2006-06-13 17:52:25 UTC
Created attachment 431 [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 3 Jim Melton 2006-06-13 17:56:08 UTC
Thank you for your comment.  The XML Query WG agrees that you have identified a bug in the XQueryX specification and has endorsed a change to that spec that fixes the bug. 

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. 

Please examine the attached stylesheet, particularly the two templates that handle the element <xqx:Wildcard/>, to see the changes that were approved. 

We believe that this change satisfies your concerns.  I have marked this bug as FIXED and request that you mark it CLOSED at your earliest convenience.  If you disagree with the resolution of this bug, please enter an additional comment to explain your reasons.