This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
These two tests are invalid with respect to the XQueryX schema, since neither piTarget 123ncname (K2-NameTest-21) nor prefix:b (K2-NameTest-23) are valid NCName values. <xsd:element name="piTarget" type="xsd:NCName" minOccurs="0"/>
Both tests are documented as being error cases, so why is this a problem?
They're listed as expecting a type checking error at runtime, rather than failing to parse. What benefit is there from including invalid XQueryX in the test suite?
>They're listed as expecting a type checking error at runtime, rather than failing to parse. No, type errors can be reported either statically or dynamically. >What benefit is there from including invalid XQueryX in the test suite? It tests that a processor can handle invalid input - which is surely a reasonable test?
>It tests that a processor can handle invalid input - which is surely a >reasonable test? Indeed this is reasonable, but these a Then this test case should be marked as expecting a parse error in the XQueryX case. Our implementation raises a System.Xml.Schema.XmlSchemaValidationException which we report directly - rather than reporing it as XPST0003 which would be inappropriate since this is XQueryX we're dealing with. (XPST0003: It is a static error if an expression is not a valid instance of the grammar defined in A.1 EBNF) Or do you suggest that we attempt to observe XPTY0004 by static type analysis of a syntactically invalid XQueryX program?
I agree that it's not really reasonable to expect an XQueryX processor to produce different error codes for different kinds of schema-invalid XQueryX inputs. To be honest, I've no idea why this one is a type error rather than a static error anyway. It seems a curious decision. Apart from the error code, it seems a reasonable test to include in the test suite.
Thanks for pointing this out. From time to time I generate the XQueryX test cases that correspond to new or modified XQuery test cases. In generating XQueryX test cases, I skip any XQuery test cases that are parse errors and any XQuery test cases that translate to XQueryX documents that do not validate. K2-NameTest-21 and K2-NameTest-23 generated valid XQueryX at one time. When errata XQ.E12 (based on Bug #5351) is considered, this is no longer the case. Sometime in January I plan to regenerate all of the XQueryX test cases. At that time I will remove K2-NameTest-21 and K2-NameTest-23.
I've updated the XQueryX documents in the test suite and removed the XQueryX for K2-NameTest-21 and K2-NameTest-23. Please close this bug report if you agree with this resolution.