<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>29996</bug_id>
          
          <creation_ts>2016-11-10 15:39:08 +0000</creation_ts>
          <short_desc>RelaxNG EQName definition too loose.</short_desc>
          <delta_ts>2016-11-16 17:02:22 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XPath / XQuery / XSLT</product>
          <component>XSLT 3.0</component>
          <version>Member-only Editors Drafts</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>minor</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Charles Foster">charles</reporter>
          <assigned_to name="Michael Kay">mike</assigned_to>
          
          
          <qa_contact name="Mailing list for public feedback on specs from XSL and XML Query WGs">public-qt-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>128134</commentid>
    <comment_count>0</comment_count>
    <who name="Charles Foster">charles</who>
    <bug_when>2016-11-10 15:39:08 +0000</bug_when>
    <thetext>The RelaxNG Schema definition for an EQName is as follows:

eqname.datatype = xsd:QName | xsd:token { pattern = &quot;Q\{[^{}]*\}\i\c*|\i\c*:.+&quot; }

This type allows values such as &quot;a:b:c&quot;, which would be invalid EQNames.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>128135</commentid>
    <comment_count>1</comment_count>
    <who name="Charles Foster">charles</who>
    <bug_when>2016-11-10 15:49:38 +0000</bug_when>
    <thetext>I suggest replacing the definition of the eqname.datatype from:

eqname.datatype = xsd:QName | xsd:token { pattern = &quot;Q\{[^{}]*\}\i\c*|\i\c*:.+&quot; }

And instead, use the following:

uri.qualified.name = xsd:token { pattern = &quot;Q\{[^\{\}]*\}[\i-[:]][\c-[:]]*&quot; } 
qname.strict = xsd:token { pattern = &quot;[\i-[:]][\c-[:]]:[\i-[:]][\c-[:]]&quot; }
eqname.datatype = xsd:QName | uri.qualified.name | qname.strict 

This would allow regular QNames, or Qualified names defined by uri.qualified.name, or strict QNames defined by &quot;qname.strict&quot; and will not allow &quot;a:b:c&quot;.

On applying this locally to the RNC in the test suite, all XSLT tests validate except from &quot;xml-version-025.xsl&quot;. The reason why this fails is because Jing (at least the version I have) does not support The RexEx notions of \i and \c correctly.

I plan to submit a patch to Jing in order that \i and \c are properly supported, which would result in &quot;xml-version-025.xsl&quot; passing, but for the now at least, I believe the RelaxNG code written above is correct regardless of the Jing RelaxNG implementation failing to validate a correct XSLT file.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>128137</commentid>
    <comment_count>2</comment_count>
    <who name="Charles Foster">charles</who>
    <bug_when>2016-11-10 17:56:05 +0000</bug_when>
    <thetext>This was discussed on the Telcon (2016-11-10).

Michael Kay asked why the RegEx is not the same as the one in the XSD.

Abel Braaksma explained that the XSD benefits from inheritance of patterns, which is different in this case.

Everybody seems to agree with the proposed update in comment 1. I will push this change to the test suite and notify MK.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>128186</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-11-16 17:02:22 +0000</bug_when>
    <thetext>The updated schema has been committed.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>