Describe the bug
independent-definitions-schema.xsd and independent-system-characteristics-schema.xsd each declare a sch:pattern id more than once. ISO Schematron types @id as xsd:ID, so the assembled schema fails RELAX NG validation and the Schematron cannot be compiled at all. No rule in either schema can be evaluated, including the reference and deprecation rules that do exist and are correct.
ind-def_txt54objpattern appears three times, on shellcommand_object, shellcommand_state, and textfilecontent54_object. The first two were copied from the textfilecontent54 pattern when shellcommand was added and kept its id.
ind-sc_sql_item_dep appears twice, on sql_item and sql57_item.
Both ids were unique in 5.11.2; the duplicates arrived with the new shellcommand test and the sql57_item.
Replication Steps
- Extract the Schematron with
tools/ExtractSchFromXSD.xsl from independent-definitions-schema.xsd.
- Compile it, for example
lxml.isoschematron.Schematron(extracted).
- Compilation fails:
invalid schematron schema: <string>:1122:0:ERROR:RELAXNGV:
RELAXNG_ERR_INVALIDATTR: Invalid attribute id for element pattern
The same happens at line 465 of independent-system-characteristics-schema.xsd.
Expected behavior
Every sch:pattern/@id is unique within a schema and within its import closure, so the Schematron compiles and its rules run.
Content
| Schema |
Duplicate id |
Element |
Suggested id |
independent-definitions |
ind-def_txt54objpattern |
shellcommand_object |
ind-def_shellcommandobjpattern |
independent-definitions |
ind-def_txt54objpattern |
shellcommand_state |
ind-def_shellcommandstatepattern |
independent-definitions |
ind-def_txt54objpattern |
textfilecontent54_object |
keep as is |
independent-system-characteristics |
ind-sc_sql_item_dep |
sql_item |
keep as is |
independent-system-characteristics |
ind-sc_sql_item_dep |
sql57_item |
ind-sc_sql57_item_dep |
OVAL details
- Schema:
independent-definitions-schema.xsd, independent-system-characteristics-schema.xsd
- Test:
shellcommand, textfilecontent54, sql, sql57
Describe the bug
independent-definitions-schema.xsdandindependent-system-characteristics-schema.xsdeach declare asch:patternid more than once. ISO Schematron types@idasxsd:ID, so the assembled schema fails RELAX NG validation and the Schematron cannot be compiled at all. No rule in either schema can be evaluated, including the reference and deprecation rules that do exist and are correct.ind-def_txt54objpatternappears three times, onshellcommand_object,shellcommand_state, andtextfilecontent54_object. The first two were copied from the textfilecontent54 pattern whenshellcommandwas added and kept its id.ind-sc_sql_item_depappears twice, onsql_itemandsql57_item.Both ids were unique in 5.11.2; the duplicates arrived with the new
shellcommandtest and thesql57_item.Replication Steps
tools/ExtractSchFromXSD.xslfromindependent-definitions-schema.xsd.lxml.isoschematron.Schematron(extracted).The same happens at line 465 of
independent-system-characteristics-schema.xsd.Expected behavior
Every
sch:pattern/@idis unique within a schema and within its import closure, so the Schematron compiles and its rules run.Content
independent-definitionsind-def_txt54objpatternshellcommand_objectind-def_shellcommandobjpatternindependent-definitionsind-def_txt54objpatternshellcommand_stateind-def_shellcommandstatepatternindependent-definitionsind-def_txt54objpatterntextfilecontent54_objectindependent-system-characteristicsind-sc_sql_item_depsql_itemindependent-system-characteristicsind-sc_sql_item_depsql57_itemind-sc_sql57_item_depOVAL details
independent-definitions-schema.xsd,independent-system-characteristics-schema.xsdshellcommand,textfilecontent54,sql,sql57