Using an XSD extension for validation

By default, the UserArea is an 'AnyType', because the UserArea can contain any data: standard properties, your custom structure, or anything else. In this default situation, a BOD normally validates successfully against the BOD XSD, independent of the contents of the UserArea. If you defined a UserArea extension XSD in the Data Catalog, to use the XSD for validating your BOD XML, you must ensure the validator can find the XSD extension.

To achieve this:

  1. Add namespace information to the XSD.
    For example, the AcmeCustomContacts.xsd file can contain this code:
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
      xmlns="http://schema.acme.com/userarea"
      targetNamespace=="http://schema.acme.com/userarea"
      elementFormDefault="qualified" attributeFormDefault="unqualified">
        <xs:element name="AcmeCustomContacts" type="AcmeCustomContactsType"/>
        <xs:complexType name="AcmeCustomContactsType">
            …
        </xs:complexType>
    </xs:schema>
  2. In the XML that contains the custom data, include a reference to the namespace:
    <UserArea>
        <acme:AcmeCustomContacts xmlns:acme="http://schema.acme.com/userarea">
            <acme:Contact>
                 <acme:Name>Someone</acme:Name>
                 <acme:Email>someone@acme.com</acme:Email>
             </acme:Contact >
         </acme:AcmeCustomContacts >
    </UserArea>
    Note: The namespace, in this case "http://schema.acme.com/userarea", must be the same as in the XSD.
After completing these steps you can validate the BOD XML against the BOD XSD. In this case, for example, validate the BOD XML against SyncContract.xsd.
Note: Validation can help when you set up and test a customization, but reduces performance. Therefore, if possible, avoid validation of all messages sent or received by your application. The ION Service also does not validate the BODs against the XSDs as defined in the Data Catalog.