All XML files based on a XML Schema Definition (XSD) have a "preamble". This preamble points to the XSD that is used to validate the XML file. This also applies to all XML based DDEX messages and files.
Below is a valid preamble for a
NewReleaseMessage created in accordance for ERN 4.1.1:
The six lines contain the following information:
- Information about the XML version and encoding used. This should, in virtually all cases, be "
UTF-8". This line must be the very first line in the XML file and should always be as shown above.
- The tag name of the message (here: "
NewReleaseMessage") with a namespace prefix (here: "
This line states that the full namespace for for the namespace prefix "
ern" is "
While the full namespace looks like a URL that points to a web resource, it is, actually, not; They are URIs.
The prefix can be any valid XML token but but must remain the same in the rest of the preamble.
- The XML namespace definitions (
xmlns) for all tags in that message.
This is the namespace of the DDEX standard you are trying to work with and is referenced in the text of the standard (in ERN 4.1.1 it is in Clause 6.1, for instance.
- The XML namespace definitions for XML Schema itself.
- The location of the XSD file for the namespace that defines the elements of the DDEX message you are trying to work with. The XSD file for the XSD with the namespace defined in line 3 can be found at "http://ddex.net/xml/ern/411/release-notification.xsd" (this is a URL).
- Any XML attributes that the DDEX-defined message needs (here: "
The preamble above points to a XSD file hosted on a DDEX Server. It can also point to a file in your local hard drive, In that case that line would be, for instance:
There is no need to reference any other XML schema definition files (e.g. the ones containing the allowed value sets) as these XSD files are imported by the main XSD file