[Bug 11446] Provide alternate result for test K2-Literals-1

http://www.w3.org/Bugs/Public/show_bug.cgi?id=11446

Michael Dyck <jmdyck@ibiblio.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jmdyck@ibiblio.org

--- Comment #5 from Michael Dyck <jmdyck@ibiblio.org> 2010-12-01 19:39:34 UTC ---
[Personal response]
You don't actually say *why* you think XPST0003 should be added as an
alternative result for this test-case.

The description of XPST0003 says:
"It is a static error if an expression is not a valid instance of the grammar
defined in A.1 EBNF."

The query is basically:
    "&#x00;"
which is an instance of the StringLiteral production, containing an instance of
the CharRef production. (That's under XQuery; it's different for XPath.)

The production for CharRef is a cross-reference to the CharRef production in
XML 1.0 or 1.1 (imp-def choice), which in either case is:
    CharRef ::= '&#' [0-9]+ ';' | '&#x' [0-9a-fA-F]+ ';'
And
    &#x00;
is a syntactically valid instance of that production.

Now, the CharRef production in the XML specs is also annotated with a
well-formedness constraint:
    Characters referred to using character references
    MUST match the production for Char.
And the character referred to by
    &#x00;
does not match that production. Is *that* why you think the query is not an
instance of the XQuery grammar?

If so, I would point out that well-formedness constraints are constraints on
*XML documents*, not XQuery expressions/modules. That is, I believe that when
XQuery's grammar cross-reference another spec's production, it only "imports"
the EBNF of that production, not any annotations it might have. (That's why the
XQuery spec needs to separately define the conditions for an error such as
XQST0090.)

More formally, XQuery's A.1.1 defines the cross-reference notation as follows:
    [http://www.w3.org/TR/REC-example/#NT-Example]
    matches any string matched by the production defined in
    the external specification as per the provided reference.
And I believe it's correct to say that
    &#x00;
matches the CharRef production in the XML spec. It doesn't satisfy the
associated well-formedness constraint (or more precisely, a textual object
containing such an instance would not meet that constraint, and so would not be
a well-formed XML document), but that's a separate matter.

-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Wednesday, 1 December 2010 19:39:38 UTC