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 9900 - XML10-5ed-Included-char-1
Summary: XML10-5ed-Included-char-1
Status: CLOSED FIXED
Alias: None
Product: XML Query Test Suite
Classification: Unclassified
Component: XML Query Test Suite (show other bugs)
Version: unspecified
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Andrew Eisenberg
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-10 12:40 UTC by Michael Kay
Modified: 2010-06-10 17:18 UTC (History)
0 users

See Also:


Attachments

Description Michael Kay 2010-06-10 12:40:34 UTC
This test contains a DEL character (x7F) within a direct element constructor, and permits the error XPST0003. The test metadata contains the description:

Contains a DEL, legal in XML 1.0, illegal in XML 1.1.

First problem: this comment is a simplification of the rules. XQuery allows any Char to appear in the content of a direct element constructor, and defines Char by reference to the relevant production rule in the XML specification. XML 1.0 (all editions) contains the production rule:

[2]   	Char	   ::=   	#x9 | #xA | #xD | [#x20-#xD7FF] | ...

while XML 1.1 has

[2]   	Char	   ::=   	[#x1-#xD7FF] |  ...

In both, the production rule Char allows x7F. It's true that XML 1.1 has a rule saying that x7F is a RestrictedChar which means it can only appear in element content if written as a character reference. But this test uses x7F in an XQuery direct element constructor, not in an XML document. XQuery allows you to use either definition of Char, but it does not allow you to say "direct element constructors in XQuery are supposed to look a bit like elements in XML, so I will adopt the rules about not allowing RestrictedChar to appear". So I think this query should not permit the error case: the query is legal, regardless what version of XML you support.

Second problem: I hit upon this because the Saxon test driver was producing results, but failing to compare them with the reference results because of a failure in the canonicalizer. This was caused by using an XML 1.1 parser to compare the results, which fails because the expected results file contains a DEL character written as a literal character, not as a numeric character reference. I think it would be desirable if the expected results file can be parsed by an XML 1.1 parser, and it should therefore use a numeric character reference & # x 7 f ; here.
Comment 1 Andrew Eisenberg 2010-06-10 15:13:56 UTC
Interesting. XML 1.1 restricts the use of the x7F character with:

[1]  document        ::=  (  prolog  element  Misc*  )   -  (  Char* RestrictedChar    Char*  )  

[2]  Char            ::=  [#x1-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]

[2a] RestrictedChar  ::=  [#x1-#x8] | [#xB-#xC] | [#xE-#x1F] | [#x7F-#x84] | [#x86-#x9F]


As you point out, the Char production, which we reference in XQuery, accepts x7F.

I've made the two changes you requested:
1) the expected error has been removed
2) the expected result uses a charRef to include the x7F character


Please confirm these changes and close this bug report.
Comment 2 Michael Kay 2010-06-10 17:18:51 UTC
Test now ok, thanks.