XML validation
Message XSD and AVS XSD
DDEX publishes two XML Schema Definition (XSD) files for each standard:
One that defines the structure of the messages defined by that standard, sometimes referred to as the “message XSD”; and
A second that defines all the allowed-values for all the DDEX standards, sometimes referred to as the “AVS XSD”.
When ingesting an XML DDEX formatted message, the message XSD loads the AVS XSD so that when there is validation as part of the ingestion process, the AVS is validated at the same time.
XSD file locations
The two XSDs are published in two locations:
The “online versions” are published on a web server at the URL indicated by the namespace defined in the standard. Implementers of the standards can use the online versions of the XSDs for their applications as well as for their production system.
For example, the XSD for Version 4.3 of the ERN standard, which has a namespace of
http://ddex.net/xml/ern/43
, is published on the DDEX website athttp://ddex.net/xml/ern/43/release-notification.xsd
;The online version of the message XSD then imports the online version of the AVS XSD, which is located at
http://ddex.net/xml/allowed-value-sets/allowed-value-sets.xsd"
for ERN 4.3.
The XSDs are also published on this knowledge base for downloading and for local, offline, use:
For all XML standards, the XSD files are contained in a zip file that can be downloaded from the this knowledge base the links for which appear under the section Reference material alongside the text of the relevant standard;
When ingesting an XML DDEX formatted message, the offline message XSD loads the AVS XSD from the same zip file (not the online version explained above), thus enabling the XSDs to be used without the need for an internet connection.
Other than the fact that the XSDs are located both online and offline there is no difference between the two sets of XSDs. This is true of most recent versions of the DDEX standards. For older versions there is the possibility that the online AVS XSD has been updated since the offline XSD was published.
The first step to validating a DDEX message is to verify that the structure of the XML file conforms to the XML Schema Definition file for that standard. Examples of how XML validation can be done are available here.