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 3090 - XQTSCatalog.xsd: constrain test-case/@name and test-group/@name with IDC
Summary: XQTSCatalog.xsd: constrain test-case/@name and test-group/@name with IDC
Status: CLOSED FIXED
Alias: None
Product: XML Query Test Suite
Classification: Unclassified
Component: XML Query Test Suite (show other bugs)
Version: 0.8.6
Hardware: PC Linux
: P2 enhancement
Target Milestone: ---
Assignee: Andrew Eisenberg
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-04-06 16:17 UTC by Frans Englich
Modified: 2006-04-13 14:02 UTC (History)
0 users

See Also:


Attachments

Description Frans Englich 2006-04-06 16:17:49 UTC
The names of groups and test cases, test-case/@name and test-group/@name respectively, are treated as identifiers, and test-cases are referred to by their name. This suggests that the names should be unique. So, in order to ensure that, why not validate it with the schema?

Below(attaching files doesn't work at least for me) is a patch adding identity constraints to XQTSCatalog.xsd. I think the same should be done for XQTSResult.xsd, to ensure test result are not listed twice. (Producing patches would be greatly simplified with repository access)

When applied XQTSCatalog.xml contains at least one error: DurationArith is used twice.


Regards,
Frans


--- XQTSCatalog.old.xsd	2006-04-05 14:33:30.000000000 +0000
+++ XQTSCatalog.xsd	2006-04-06 15:37:32.000000000 +0000
@@ -378,5 +378,16 @@
             <xs:attribute name="XQueryFileExtension" type="xs:string" use="required" />
             <xs:attribute name="XQueryXFileExtension" type="xs:string" use="required" />
         </xs:complexType>
+
+        <xs:unique name="unique-test-group">
+          <xs:selector xpath=".//test:test-group"/>
+          <xs:field xpath="@name"/>
+        </xs:unique>
+
+        <xs:unique name="unique-test-case">
+          <xs:selector xpath=".//test:test-case"/>
+          <xs:field xpath="@name"/>
+        </xs:unique>
+
     </xs:element>
</xs:schema>
Comment 1 Frans Englich 2006-04-11 21:12:45 UTC
From a quick glance it looks like other fields as well could be constrained:

* citations/citation-spec/@name
* comparisons/comparison/@name
* roles/role/@name
* scenarios/scenario/@name
* sources/source/@ID (?)
* schemas/schema/@ID (?)
* implementation-defined-items/implementation-defined-item/@name
* features/feature/@name
* context-properties/context-property/@name

I guess they are of less important compared to test-case/test-group.


Regards,
Frans
Comment 2 Andrew Eisenberg 2006-04-11 22:28:47 UTC
I have made the changes that you suggested. Doing so uncovered a duplicate implementation-defined-item as well as the duplicate test-group that you mentioned.

I did not make a change to the two items you marked with a "?":

* sources/source/@ID (?)
* schemas/schema/@ID (?)

I think that the id/idref attributes that we use are sufficient for these elements.
Comment 3 Frans Englich 2006-04-13 14:02:37 UTC
Nice. I agree with the solution and therefore change status to CLOSED.


Regards,
Frans