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 29996 - RelaxNG EQName definition too loose.
Summary: RelaxNG EQName definition too loose.
Status: RESOLVED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XSLT 3.0 (show other bugs)
Version: Member-only Editors Drafts
Hardware: PC All
: P2 minor
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-11-10 15:39 UTC by Charles Foster
Modified: 2016-11-16 17:02 UTC (History)
0 users

See Also:


Attachments

Description Charles Foster 2016-11-10 15:39:08 UTC
The RelaxNG Schema definition for an EQName is as follows:

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

This type allows values such as "a:b:c", which would be invalid EQNames.
Comment 1 Charles Foster 2016-11-10 15:49:38 UTC
I suggest replacing the definition of the eqname.datatype from:

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

And instead, use the following:

uri.qualified.name = xsd:token { pattern = "Q\{[^\{\}]*\}[\i-[:]][\c-[:]]*" } 
qname.strict = xsd:token { pattern = "[\i-[:]][\c-[:]]:[\i-[:]][\c-[:]]" }
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 "qname.strict" and will not allow "a:b:c".

On applying this locally to the RNC in the test suite, all XSLT tests validate except from "xml-version-025.xsl". 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 "xml-version-025.xsl" 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.
Comment 2 Charles Foster 2016-11-10 17:56:05 UTC
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.
Comment 3 Michael Kay 2016-11-16 17:02:22 UTC
The updated schema has been committed.