[Bug 3022] [XQueryX] transform of empty <xqx:Wildcard>

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

           Summary: [XQueryX] transform of empty <xqx:Wildcard>
           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: andrew.eisenberg@us.ibm.com
         QAContact: public-qt-comments@w3.org


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>

Received on Monday, 20 March 2006 18:24:53 UTC