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 12056 - [XQuery] error for "XML" as PITarget
Summary: [XQuery] error for "XML" as PITarget
Status: CLOSED INVALID
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XQuery 1.0 (show other bugs)
Version: 2nd Edition Recommendation
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Jonathan Robie
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-14 09:18 UTC by Michael Dyck
Modified: 2011-02-16 02:49 UTC (History)
3 users (show)

See Also:


Attachments

Description Michael Dyck 2011-02-14 09:18:50 UTC
3.7.2 Other Direct Constructors
"The PITarget of a processing instruction may not consist of the characters "XML" in any combination of upper and lower case."

The spec should say what error to raise for violations of this requirement.

(This bug is similar to Bug 11609.)
Comment 1 Michael Kay 2011-02-14 10:56:10 UTC
It should also say "must not" rather than "may not".
Comment 2 Liam R E Quin 2011-02-14 18:14:22 UTC
There are other examples where the resulting document will not be well formed and it's not an error. I'd rather that this was left as a SHOULD, possibly with a note about how <?xml ...?> will likely be interpreted as an XML declaration, and pointing to serialization options to control what goes there.
Comment 3 Michael Dyck 2011-02-15 06:27:20 UTC
(In reply to comment #1)
> It should also say "must not" rather than "may not".

(Indeed: it's been changed to "must not" in 3.0.)
Comment 4 Michael Dyck 2011-02-15 06:29:33 UTC
(In reply to comment #2)
> I'd rather that this was left as a SHOULD,

You mean *changed to* a SHOULD? Or do you mean that the current wording is effectively a SHOULD?
Comment 5 Henry Zongaro 2011-02-15 15:34:37 UTC
Section 3.7.3.5[1] makes it a dynamic error (err:XQDY0064) for the target of a computed processing instruction constructor "if the NCName is equal to "XML" (in any combination of upper and lower case) [err:XQDY0064]."

I submit that it was merely an oversight not to apply the same or a similar error for a direct processing instruction constructor.

[1] http://www.w3.org/TR/2010/REC-xquery-20101214/#id-computed-pis
Comment 6 Henry Zongaro 2011-02-15 16:05:28 UTC
Now that I think about it, I believe the error for the PITarget in 3.7.2 is XPST0003.  The definition of PITarget is, by reference to the appropriate version of XML,

PITarget	   ::=   	Name - (('X' | 'x') ('M' | 'm') ('L' | 'l'))

If the PITarget were XmL, say, that would not conform to the syntax of XQuery, so error XPST0003 results.  I believe the text in 3.7.2 is drawing attention to that restriction.
Comment 7 Michael Dyck 2011-02-16 02:48:39 UTC
(In reply to comment #6)
> The definition of PITarget is, by reference to the appropriate
> version of XML,
> 
> PITarget       ::=       Name - (('X' | 'x') ('M' | 'm') ('L' | 'l'))

Ah! I had been thinking PITarget was just NCName. XPST0003 it is then.

I'll mark this as resolved-invalid, then close it.