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 3731 - version declaration after comment
Summary: version declaration after comment
Status: CLOSED INVALID
Alias: None
Product: XML Query Test Suite
Classification: Unclassified
Component: XML Query Test Suite (show other bugs)
Version: 1.0
Hardware: PC Linux
: 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: 2006-09-15 13:55 UTC by Per Bothner
Modified: 2006-09-19 10:16 UTC (History)
0 users

See Also:


Attachments

Description Per Bothner 2006-09-15 13:55:27 UTC
version_declaration-001.xq is marked as <expected-error>*</expected-error>.  Since I cannot see anything else wrong with the query, I'm assuming this si because there is a comment before the version declaratiion.  This implies that an XQuery implementation is rquired to reject a version declaration that follows a comment. But the Specification [4.1] says:  "If such a Comment [before the end of the version declaration] is present, the result is implementation-dependent." That to me seems to say that an implementation is *not* requiredto reject this query.

I guess I'm asking for guidance here.  Does what does <expected-error>*</expected-error> mean in this context?

The same applies to version_declaration-002, version_declaration-003, version_declaration-004, and version_declaration-005.
Comment 1 Frans Englich 2006-09-15 14:03:50 UTC
Are you really sure about this? To me test version_declaration-001 has a text base line of "1 2"(same applies to the other tests). Therefore, the tests seems ok to me.

So, I'm currently thinking about closing this report as invalid.

<expected-error>*</expected-error> means that any error code is ok.
Comment 2 Per Bothner 2006-09-15 14:34:53 UTC
(In reply to comment #1)
> Are you really sure about this?

No - that's why I'm asking.

> To me test version_declaration-001 has a text
> base line of "1 2"(same applies to the other tests).

What is "text base line" and where is it defined?

> <expected-error>*</expected-error> means that any error code is ok.

But does it also mean that "no* error code is ok?  If so, that should be clarified in "Guidelines for Test Submission.html".
Comment 3 Frans Englich 2006-09-15 16:13:22 UTC
Here's the XQTSCatalog.xml entry for version_declaration-001 in CVS(I believe the catalog in the 1.0 release is identical):

               <test-case is-XPath2="false" name="version_declaration-001" FilePath="Expressions/PrologExpr/VersionProlog/" scenario="standard" Creator="Pulkita Tyagi">
                  <description>Demonstrates version declaration,the version.</description>
                  <spec-citation spec="XQuery" section-number="4.1" section-title="Version Declaration" section-pointer="id-version-declaration"/>
                  <query name="version_declaration-001" date="2005-10-05"/>
                  <input-file role="principal-data" variable="input-context">emptydoc</input-file>
                  <output-file role="principal" compare="Text">version_declaration-001.txt</output-file>
                  <expected-error>*</expected-error>
               </test-case>

Notice this line:

<output-file role="principal" compare="Text">version_declaration-001.txt</output-file>

This means there is a base line(something to compare the test result against) in file version_declaration-001.txt which should be compared with the Text method. Guidelines for Running the XML Query Test Suite says: 'Text: Same comparison as "XML fragment".'

Low level details of the XML format is documented in XQTSCatalog.xsd(although I agree it can be more extensive). See the global type QueryErrorCode.

So no, '*' does not mean no error code is acceptable, but that one error code that is any error code is acceptable.

Thanks for asking, I hope it helps.
Comment 4 Per Bothner 2006-09-15 16:44:28 UTC
(In reply to comment #3)
> So no, '*' does not mean no error code is acceptable, but that one error code
> that is any error code is acceptable.

My point still remains: the XQuery Specification does not seem to require an error in this situation.  I would expect "Implementation dependent" to mean no diagnostic is required.  If my reading is current, then the testsuite should not require an error code here.

Comment 5 Frans Englich 2006-09-15 17:00:42 UTC
Here's how I see it:

That particular baseline, the one which allows any error code, doesn't allow no error code. However, since there also is a text baseline, an implementation can pass the test by evaluating to a result that matches the text baseline. Multiple baselines means that an implementation can pass the test in anyway that a baseline allows.
Comment 6 Andrew Eisenberg 2006-09-15 18:59:13 UTC
I believe that Frans' statements have all been accurate. We expect an implementation to pass if it returns "1 2" or it returns any error.

This is, admittedly, a bit more restrictive than rules of the XQuery specification, which says:

"If a version declaration is present, no Comment may occur before the end of the version declaration. If such a Comment is present, the result is implementation-dependent."

If an implementation returns "2 3" and wants to challenge this, then we would have to accept it.
Comment 7 Michael Kay 2006-09-17 07:39:12 UTC
>If an implementation returns "2 3" and wants to challenge this, then we would
have to accept it.

And of course, if the comment has confused the implementation into decoding the query incorrectly, such a result is theoretically possible; so I think the spec should stay as it is.
Comment 8 Per Bothner 2006-09-19 06:40:44 UTC
Ok, I didn't realise that a test-case could have both output-file and expected-error as possible outcomes.

I now understand that a test-case have zero or more output-file non-error outcomes *and* zero or more expected-error outcomes, any of which might be valid.  That wasn't clear to me before.

Thanks for the responses.  I've marked the report as "invalid".