Skip to content

Duplicate sch:pattern ids prevent Schematron compilation for both independent schemas #340

Description

@dragosprisaca

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

  1. Extract the Schematron with tools/ExtractSchFromXSD.xsl from independent-definitions-schema.xsd.
  2. Compile it, for example lxml.isoschematron.Schematron(extracted).
  3. 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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

BugA technical or implementation-related issue with an OVAL schema or construct.Platform IndependentIssue related to the Platform Independent schema

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions