Skip to content

Instantly share code, notes, and snippets.

@andylolz
Created September 16, 2021 07:38
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/c283123e4424e31926e41f424b971559 to your computer and use it in GitHub Desktop.
Save andylolz/c283123e4424e31926e41f424b971559 to your computer and use it in GitHub Desktop.
A minimal XSD for validating the mapping.xml file in http://github.com/IATI/IATI-Codelists
<?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: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