3MFConsortium / test_suites

This repository contains 3MF conformance test suites. Each test suite provides coverage for a specific combination of 3MF Core and Extension requirements.
BSD 2-Clause "Simplified" License
7 stars 0 forks source link

New test more strictly validate the relationship ID. #66

Closed jordig100 closed 3 years ago

jordig100 commented 4 years ago

According to OPC spec: The package implementer shall require that every Relationship element has an Id attribute, the value of which is unique within the Relationships part, and that the Id datatype is xsd:ID, the value of which conforms to the naming restrictions for xsd:ID as described in the W3C Recommendation “XML Schema Part 2: Datatypes.” [M1.26]

Which in turn: https://www.w3.org/TR/xmlschema-2/#ID [Definition:] ID represents the ID attribute type from [XML 1.0 (Second Edition)]. The ·value space· of ID is the set of all strings that ·match· the NCName production in [Namespaces in XML]. The ·lexical space· of ID is the set of all strings that ·match· the NCName production in [Namespaces in XML]. The ·base type· of ID is NCName.

https://www.w3.org/TR/xmlschema-2/#NCName [Definition:] NCName represents XML "non-colonized" Names. The ·value space· of NCName is the set of all strings which ·match· the NCName production of [Namespaces in XML]. The ·lexical space· of NCName is the set of all strings which ·match· the NCName production of [Namespaces in XML]. The ·base type· of NCName is Name.

https://www.w3.org/TR/1999/REC-xml-names-19990114/#NT-NCName NCName | ::= | (Letter | '') (NCNameChar) | / | An XML Name, minus the ":" */ -- | -- | -- | -- | --_

Which means that the relathiinship ID must start by either a Letter or a "_". For example, starting with a digit is an error.

I think it is worth to have some additional negative test case to cover it. And might be a positive with "_".

JimZuber commented 3 years ago

-Test Specification updated to add positive test for leading underscore on relationship ID and a negative test case added to test a leading numeric digit on a relationship ID -Test case P_???_030404 was updated on suites 1 to 6 -Test case N???_0405_04 was added on suites 1 to 6