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 29866 - [XSLT30] EQName type in XSD for XSLT 3.0 is too lenient
Summary: [XSLT30] EQName type in XSD for XSLT 3.0 is too lenient
Status: RESOLVED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XSLT 3.0 (show other bugs)
Version: Candidate Recommendation
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Michael Kay
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-23 13:19 UTC by Abel Braaksma
Modified: 2016-09-28 20:33 UTC (History)
0 users

See Also:


Attachments

Description Abel Braaksma 2016-09-23 13:19:37 UTC
After a long discussion today with Charles Foster we concluded that the base type for all EQNames, aptly named xsl:EQName, allows for illegal names.

The current definition is:

    <xs:union memberTypes="xs:NCName xs:QName">
      <xs:simpleType>
        <xs:restriction base="xs:token">
          <xs:pattern value="Q\{.*\}\i\c*"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:union>

this allows for "Q{x}a:b:c", which is illegal. Or even "Q{x}:::y:::".

A possible solution is to disallow the ":", but using a subtraction class:

<xs:union memberTypes="xs:NCName xs:QName">
  <xs:simpleType>
    <xs:restriction base="xs:token">
      <xs:pattern value="Q\{.*\}[\i-[:]][\c-[:]]*"/>
    </xs:restriction>
  </xs:simpleType>
</xs:union>

I've tested this definition and it seems correct.
Comment 1 Abel Braaksma 2016-09-23 13:22:45 UTC
As an aside, an EQName of the form "Q{x{}" is illegal too (according to XPath), but valid according to this type. This can be enforced by changing this further to:

<xs:pattern value="Q\{[^{}]*\}[\i-[:]][\c-[:]]*"/>
Comment 2 Michael Kay 2016-09-28 20:33:55 UTC
Thank you, this correction has been applied.