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 2903 - fn-idref-xx incorrect input specified
Summary: fn-idref-xx incorrect input specified
Status: CLOSED FIXED
Alias: None
Product: XML Query Test Suite
Classification: Unclassified
Component: XML Query Test Suite (show other bugs)
Version: 0.9.4
Hardware: PC Windows XP
: P2 normal
Target Milestone: ---
Assignee: Carmelo Montanez
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-20 23:29 UTC by David Carlisle
Modified: 2006-08-09 10:00 UTC (History)
1 user (show)

See Also:


Attachments

Description David Carlisle 2006-02-20 23:29:34 UTC
fn-idref-5 is specified as taking emptydoc as input-context1
but is specified as generating a non-empty result.
I fail all the following for probably the same reason
fn-idref-5
fn-idref-6
fn-idref-7
fn-idref-8
fn-idref-9
fn-idref-10
fn-idref-11
fn-idref-12
fn-idref-13
fn-idref-14
fn-idref-15
fn-idref-16
fn-idref-17
fn-idref-18
fn-idref-19
fn-idref-20
fn-idref-21
Comment 1 Carmelo Montanez 2006-03-06 15:42:47 UTC
David:

Correct.  Changed the catalog file to load the correct file.  Please close the
bug if in agreement and able to verify.

Thanks,
Carmelo
Comment 2 Michael Kay 2006-03-08 16:31:47 UTC
It would be helpful, Carmelo, if you could tell us what the correct source file is!
Comment 3 Carmelo Montanez 2006-03-09 19:21:00 UTC
oops sorry.  It is "id.xml".  I will submit a new version of it now.
The one that was released, I am afraid may not be good enough to run the 
tests.  I can e-mail you a copy of it or you can grab it from the
CVS repository.  Should be ready in about 10 minutes.

Carmelo
Comment 4 Michael Kay 2006-04-27 08:17:07 UTC
The id.xml file included in the 0.9.0 distribution is wrong. It contains elements such as

<elementwithidref-1>id1</elementwithidref-1>

where id1 is supposedly an IDREF value; but there is no way of achieving this with a DTD, it can only be achieved with a schema. DTDs only allow IDREF attributes, not IDREF elements. The DTD defines this element as <!ELEMENT elementwithidref-1 (IDREF)> which declares an element that has a child element named IDREF (and doesn't allow #PCDATA content) - this document therefore isn't even valid against the DTD.
Comment 5 Alberto Massari 2006-05-03 13:20:18 UTC
Also, the DTD is missing this declaration

<!ATTLIST elementwithid-5
    anId ID #REQUIRED>

Also, it would be helpful if the DTD was defined in an external file.
Comment 6 Alberto Massari 2006-05-03 13:22:19 UTC
Another limitation of DTDs is that an element can only have one ID attribute: so

<!ATTLIST elementwithid-4 
    anId3 ID #REQUIRED
    anId4 ID #REQUIRED>    

is not correct
Comment 7 Carmelo Montanez 2006-05-03 19:16:17 UTC
All:

I will turn the file into a schema.

Carmelo
Comment 8 Carmelo Montanez 2006-05-15 20:19:49 UTC
David:

Thanks for the comment.  The "id.xml" was modified to be valid in relation 
to the "id.xsd" schema.  The tests were changed to reflect schema usage. 
New tests (and where required, new results) were submitted.  Catalog file was changed to reflect new inputs.  

Please close the bug in in agreement.  Somehow I think this is not quiet over yet.

Thanks,
Carmelo
Comment 9 David Carlisle 2006-06-13 12:11:30 UTC
Reopening this one.
the tests that now depend on PSVI input (eg fn-idref-5) should be moved to an optional area of the test suite for systems supporting the schema import feature, or (less useful)
alternative expected results should be provided for the case that there are no
nodes of type ID or IDREF in the input (as no DTD is provided).

If the tests are left in the minimal conformance area, and just additional expected result files are provided which typically will be empty as nothing will be selected by id() or idref() then the tests are seriously weekened as a system would "pass" the tests if it just had a stub implementation that always returned ().




David
Comment 10 Carmelo Montanez 2006-06-13 14:38:11 UTC
Dave:

Thanks for the message.  Although I agree with you that adding the extra
outcome can weaken the test somewhat, I will be relutant to just move the tests
as there are others, which use schema and still part of the minimal
area tests.  

Thanks,
Carmelo
Comment 11 David Carlisle 2006-06-13 15:03:30 UTC
It doesn't just weaken them a bit, it really renders them pointless as a system can pass them just by making the functions no-op. 

Where there are multiple output-files supplied then (where it makes sense) there should be an extra attribute in the catalogue saying which kinds of processors should use which
expected result file. So in this case a system supporting psvi input would be required to return the current expected result file, and a system  not supporting psvi input would be required to return an empty result. There should also be some tests testing id/idref based on dtd declarations so that non schema systems also get tested for real implementations of id/idref. Note that supporting psvi input is not the same as supporting the schema import feature.
(Perhaps it should be. XSLT2 for example bans a system  that does not support schmema import from supporting schema type annotations on input)


> I will be relutant to just move the tests
> as there are others, which use schema and still part of the minimal
> area tests.

Which is an architectural bug in the test suite, that "minimal" set of tests requires a feature that is explictly out of scope of the spec. The real fix is just not to do that, masking the problem by providing multiple result files, especially if these are not categorised in any way, is just papering over the cracks.



David (not really as grumpy as the above may indicate)
Comment 12 Carmelo Montanez 2006-06-13 19:00:14 UTC
Dave:

Thanks for the point.  We will look into this issue at the conf call.
Your comments are always welcome.  You provide good feedback.

Carmelo
Comment 13 Michael Kay 2006-06-19 20:00:30 UTC
Just one extra minor detail to add to this sorry tale: in converting the tests to work with a schema, the namespace of the source documents was changed, but the namespace of the result documents was left null. So of course all the results are wrong even if you can get the test working.
Comment 14 Carmelo Montanez 2006-06-20 17:21:29 UTC
Dave:

We discussed your suggestions, but yet decided that it is better to leave the tests where they are and just allow for the alternate results.  We are very much aware of your arguments, but given the nature of fn:id and fn:idref,
a schema seems like a natural for those.

Thanks,
Carmelo
Comment 15 David Carlisle 2006-06-21 10:08:15 UTC
> but given the nature of fn:id and fn:idref,
> a schema seems like a natural for those.

I disagree, sorry.
ID and IDREF have been supported in DTD based products for around 20 years now,
so rather longer than XSD schema has been around. A conforming XQuery system explictly does not need to support XSD schema, but does need to support the core F&O functions relating to ID processing. Given that XSD support in Xquery is an
optional feature, it is wrong to use it to test mandatory features.

David

Comment 16 Carmelo Montanez 2006-06-23 14:33:00 UTC
Dave:

I write a DTD version of the ID/IDREF tests and make them available
from the basic area. 

Carmelo
Comment 17 David Carlisle 2006-06-23 14:41:54 UTC
Thanks, sorry to cause extra work:-)
Comment 18 Carmelo Montanez 2006-06-23 15:23:38 UTC
Its not a problem at all.  Hallf way there already!

Carmelo