Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include backward compatible versions in spase.xsd #24

Open
berniegsfc opened this issue Apr 25, 2023 · 1 comment
Open

Include backward compatible versions in spase.xsd #24

berniegsfc opened this issue Apr 25, 2023 · 1 comment
Assignees

Comments

@berniegsfc
Copy link
Collaborator

spase-version.xsd only includes a single Version value so it is not possible to use it to validate documents with older, yet compatible Version values. For example, with spase-2.5.0.xsd, we have

   <xsd:simpleType name="Version">
      <xsd:restriction base="xsd:string">
         <xsd:enumeration value="2.5.0" />
      </xsd:restriction>
      </xsd:simpleType>

which fails to validate an older version spase document

$ xmllint --schema spase-2.5.0.xsd HP_DataPolicy_v1.2.xml
...
HP_DataPolicy_v1.2.xml:2: element Version: Schemas validity error : Element '{http://www.spase-group.org/data/schema}Version': [facet 'enumeration'] The value '2.3.0' is not an element of the set {'2.5.0'}.
HP_DataPolicy_v1.2.xml:2: element Version: Schemas validity error : Element '{http://www.spase-group.org/data/schema}Version': '2.3.0' is not a valid value of the atomic type '{http://www.spase-group.org/data/schema}Version'.
HP_DataPolicy_v1.2.xml fails to validate

If however, spase-2.5.0.xsd contained

   <xsd:simpleType name="Version">
      <xsd:restriction base="xsd:string">
         <xsd:enumeration value="2.2.1" />
         <xsd:enumeration value="2.2.2" />
         <xsd:enumeration value="2.3.0" />
         <xsd:enumeration value="2.4.0" />
         <xsd:enumeration value="2.4.1" />
         <xsd:enumeration value="2.5.0" />
      </xsd:restriction>
      </xsd:simpleType>

the older version document would validate with the 2.5.0 schema.

@lfb12345
Copy link
Collaborator

lfb12345 commented Jul 9, 2023

I am not sure how to adjust the XSD construction for your request but am looking into this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants