Skip to content

Instantly share code, notes, and snippets.

@andylolz
Created September 18, 2021 11:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andylolz/b537ff3b3c8f96440de64ea6dd4a227e to your computer and use it in GitHub Desktop.
Save andylolz/b537ff3b3c8f96440de64ea6dd4a227e to your computer and use it in GitHub Desktop.
An XSD for validating the updated mapping.xml file (i.e. including validation-rules)
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd"/>
<xsd:element name="mappings">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="mapping" minOccurs="1" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="mapping">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="path" type="xsd:string" minOccurs="1" maxOccurs="1" />
<xsd:element name="codelist" minOccurs="1" maxOccurs="1">
<xsd:complexType>
<xsd:attribute name="ref" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
<xsd:element name="condition" type="xsd:string" minOccurs="0" maxOccurs="1" />
<xsd:element ref="validation-rules" minOccurs="1" maxOccurs="1" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="validation-rules">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="validation-rule" minOccurs="1" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="validation-rule">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="priority" type="xsd:string" minOccurs="1" maxOccurs="1" />
<xsd:element name="severity" type="xsd:string" minOccurs="1" maxOccurs="1" />
<xsd:element name="category" type="xsd:string" minOccurs="1" maxOccurs="1" />
<xsd:element name="id" type="xsd:string" minOccurs="1" maxOccurs="1" />
<xsd:element name="message" type="xsd:string" minOccurs="1" maxOccurs="1" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment