Schema location

In output instance documents, all used namespaces are declared in the document’s root tag. If the output instance document contains replacement elements that are declared in custom namespaces, these namespaces are also declared.

This is an example of BOD instance:

<SyncProductionOrder xmlns="http://schema.infor.com/InforOAGIS/2" 
xmlns:cust="http://schema.infor.com/InforOAGIS/Custom" releaseID="9.2" versionID="2.7.0">

A custom schema is referenced from the instance document, not from the schema for the default namespace. For an XML processor to be able to validate the document, schema locations must be given so that all namespaces can be found. For the example above, the default namespace is defined in the main schema, which is the BOD schema.

The custom namespace is defined in one or more custom schemas. The locations for these schemas are specified through the attribute xsi:schemaLocation as multiple value pairs, separated by a space.

Follow these guidelines:

  • The first value is the namespace to use.

  • The second value is the location of the XML schema to use for that namespace.

An XSD schema file is located by a local file path or an Internet URL.

Note: Several schemas can be used to define a namespace.

In Partner Admin (PA) tool, if you select Add Schema Location check box for the XML Transformation process step, but leave the field Schema Location blank, the original XSD file names are used, if possible. All custom schemas for the custom namespaces, if existing, are also specified. The XML schema instance namespace is also specified because the attribute schemaLocation belongs to that namespace.

For example:


<SyncProductionOrder xmlns="http://schema.infor.com/InforOAGIS/2" 
xmlns:cust="http://schema.infor.com/InforOAGIS/Custom" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://schema.infor.com/InforOAGIS/2 SyncProductionOrder.xsd 
http://schema.infor.com/InforOAGIS/Custom CustomHeader.xsd 
http://schema.infor.com/InforOAGIS/Custom CustomDetail.xsd" releaseID="9.2" versionID="2.7.0">
Note: All custom schemas for a custom namespace are always listed, even if replacement elements from all custom schemas are not mapped. If no replacement element for the custom namespace is mapped, the custom namespace and its custom schemas are not listed.

For the XML processor that receives the XML document to validate the XML document, all XSD files must reside in the XML processor’s current directory. Otherwise, the XML processor will not be able to locate the XSD files. If you want to provide a URL or a local directory path for the XSD files, you have to provide a specific schema location value. Specify a location for the main schema for the default namespace and specify locations for all custom schemas for the used custom namespaces.

If you specify the schema location in the Schema Location field for the XML Transformation process in the PA tool, you can use any file paths or Internet URLs for the schema files.

Example 1 shows the schema location string and the resulting root tag:


http://schema.infor.com/2.7.0/InforOAGIS/BODs/Developer/SyncProductionOrder.xsd 
http://schema.infor.com/Custom Custom\UserAreaExtensions\Customer\CustomHeader.xsd 
http://schema.infor.com/Custom Custom\UserAreaExtensions\Customer\CustomDetail.xsd

<SyncProductionOrder xmlns="http://schema.infor.com/InforOAGIS/2" 
xmlns:cust="http://schema.infor.com/InforOAGIS/Custom" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://schema.infor.com/InforOAGIS/2  
http://schema.infor.com/2.7.0/InforOAGIS/BODs/Developer/SyncProductionOrder.xsd 
http://schema.infor.com/Custom Custom\UserAreaExtensions\Customer\CustomHeader.xsd 
http://schema.infor.com/Custom Custom\UserAreaExtensions\Customer\CustomDetail.xsd" releaseID="9.2" versionID="2.7.0">
Note: In the PA tool, the maximum length of the field Schema Location is 256 characters.

You can use tokens that are translated to schema file names in runtime. This example shows the use of tokens <s> cust: and <s> . This schema location string will give the same result as in Example 1 above:


http://schema.infor.com/2.7.0/InforOAGIS/BODs/Developer/<s> cust: 
Custom\UserAreaExtensions\Customer\<s>

For more information about tokens, see "Namespaces in XML Transform Process" in Infor Enterprise Collaborator Partner Administration Tool User Guide.