[Bug 1287] New: pitest

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

           Summary: pitest
           Product: XPath / XQuery / XSLT
           Version: Last Call drafts
          Platform: PC
        OS/Version: Windows 2000
            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 stylesheet has

    <xsl:text>processing-instruction</xsl:text>
    <xsl:value-of select="$LPAREN"/>
    <xsl:value-of select="*"/>
    <xsl:value-of select="$RPAREN"/>
  </xsl:template>

value-of select="*" will (in xslt1) silently discard all but the first node.

this looks a bit dangereous, but actually I wonder why the schema allows more
than one node here.

The Xquery grammar has



[89 (Core)]    	PITest 	   ::=
<"processing-instruction" "("> (NCName | StringLiteral)? ")"

so 0-or-1 node that is NCName-or-String

However the XqueryX schema has



  <xsd:element name="piTest">
    <xsd:complexType>
      <xsd:choice minOccurs="0">
        <xsd:element name="piTarget" type="xsd:NCName"/>
        <xsd:element name="piValue" type="xsd:string"/>
      </xsd:choice>
    </xsd:complexType>
  </xsd:element>

so any number of "pitargets" and "pivalues". Shouldn't the schema be brought int
o line with the grammar, or, since the string version is explictly only there
for XPath1 compatibility, and equivalent to the use of an NCName, the XQueryX
version only really needs to model the child of pitest being 0-or-1 NCName.


David

Received on Tuesday, 3 May 2005 10:16:36 UTC