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 29724 - [QT3TS] eqname-909
Summary: [QT3TS] eqname-909
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XQuery 3 & XPath 3 Test Suite (show other bugs)
Version: Candidate Recommendation
Hardware: PC Mac System 7.5
: P2 normal
Target Milestone: ---
Assignee: O'Neil Delpratt
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-07 15:44 UTC by Tim Mills
Modified: 2016-08-10 15:20 UTC (History)
2 users (show)

See Also:


Attachments

Description Tim Mills 2016-07-07 15:44:34 UTC
This test needs to be split in two, for XP and XQ.

In XP31 we have the grammar

[118]   	BracedURILiteral	   ::=   	"Q" "{" [^{}]* "}"	/* ws: explicit */

while in XQ31 we have

[224]   	BracedURILiteral	   ::=   	"Q" "{" (PredefinedEntityRef | CharRef | [^&{}])* "}"


   <test-case name="eqname-909">
      <description> EQName - braces cannot be escaped by using entity references</description>
      <created by="Abel Braaksma" on="2016-06-27"/>
      <dependency type="spec" value="XP30+ XQ30+"/>
      <test><![CDATA[Q{&#x7D;http://www.w3.org/2005/xpath-functions/math}pi()]]></test>
      <result>
         <error code="XPST0003"/>
      </result>
   </test-case>
Comment 1 Tim Mills 2016-07-29 10:01:26 UTC
Test eqname-029 is similarly affected.
Comment 2 Michael Kay 2016-07-29 10:24:52 UTC
I agree.
Comment 3 Tim Mills 2016-07-29 12:56:13 UTC
I'm not convinced that eqname-909 is at all correct.

It says "braces cannot be escaped by using entity references".

Why not?  It appears to be valid according to the XQuery grammar.
Comment 4 Abel Braaksma 2016-07-31 14:19:34 UTC
(In reply to Tim Mills from comment #3)
> It says "braces cannot be escaped by using entity references".
I honestly wouldn't know. The entity reference is in XML (the source of the test), gets parsed into "}", and then doesn't fit the production "Q" "{" [^{}]* "}".

But I see it is written in a CDATA section. Which counters my suggestion above. It will result in a literal "&#x7D;", which is indeed *not* illegal, but that may not have been the intent of the test when I wrote it.
Comment 5 Michael Kay 2016-07-31 21:29:33 UTC
Because it's in a CDATA section, the characters & # x 7 D ; appear literally as part of the XPath/XQuery. 

The XQUery spec isn't 100% explicit about what a CharRef within a BracedURILiteral means, but it's hard to avoid the interpretation that &#x7D; represents a brace within the namespace URI.

Equally, the XPath spec is pretty clear that &#x7D; within a BracedURILiteral represents the sequence of characters & # x 7 D ; within the namespace URI.

The meaning in XPath and XQuery is different, but in both cases it seems to be legal.
Comment 6 Tim Mills 2016-08-10 15:19:50 UTC
I've split eqname-909 into two and corrected each.