Home | About GS1 | Products & Solutions | Services | Sectors | Contact GS1
 
XML
 - Overview
 - Technical
 - Implementation
 - Support
 - Training
 

Document layer

Return to Table of Contents

Document layer contains the actual business documents. This layer is fully documented in GS1 Business Message Standards.

Proxy files

Functionally, a business document is a part of the messaging architecture, which requires the presence of other layers – the Standard Business Document Header, transaction and command.

Some parsers (e.g. Xerces versions earlier than 2.0) do not support multiple schema locations in the instance file. In order to facilitate the process of creating valid XML messages, integrated into the whole architecture, the proxy schemas have been created for each business document that include and import all the required files. The proxy schemas are non-normative; they are created only to support implementation of the GS1 XML standards.

As a best practice GS1 recommends that if in the XML instance file the ‘xsi:schemaLocation’ attribute is used, then it should reference the actual schema file where the root element is declared. As proxy files are not part of the GS1 standard, they should be avoided if possible.

An example of a proxy schema file for the Request For Payment message follows:

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="urn:ean.ucc:2" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:import namespace="urn:ean.ucc:pay:2" schemaLocation="RequestForPayment.xsd"/>
<xsd:include schemaLocation="DocumentCommand.xsd"/>
<xsd:include schemaLocation="AllowanceCharge.xsd"/>
<xsd:include schemaLocation="PaymentTerms.xsd"/>
<xsd:include schemaLocation="TradeItemIdentification.xsd"/>
<xsd:include schemaLocation="Transaction.xsd"/>
</xsd:schema>

In the instance document these multiple file names must be replaced with the single proxy file name. If this file is specified using the 'xsi:schemaLocation' attribute, the parser is able to validate the XML instance document. An excerpt of a sample xml instance file referring to a proxy schema follows:

<?xml version="1.0" encoding="UTF-8"?>
<!-- This is a sample file-->
<sh:StandardBusinessDocument xmlns:sh="http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader" xmlns:eanucc="urn:ean.ucc:2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.unece.org/cefact/namespaces/
StandardBusinessDocumentHeader StandardBusinessDocumentHeader.xsd
urn:ean.ucc:2 RequestForPaymentProxy.xsd" xmlns:pay="urn:ean.ucc:pay:2">

Business documents

The business documents are organised by their respective business processes. Each business document requires all the included and imported files to be present for the successful validation. Each Implementers Packet for every message contains a text file called Table of Content, listing all the files that have been used to create a given business message schema and are necessary for the business document validation.

Common library

In design of each business document, some components defined in the common library are used. The common library contains all the files that may be used in more than one business document and more than one context.

The components that are used only within one context, are defined within the namespace of that particular context. Finally, components that are not used in other messages are defined locally within the business message schema.

This approach allows reusing the same information constructs in all business messages, increases interoperability and simplifies schema maintenance.

In previous GS1 XML standards releases (1.1, 1.3 and 1.3.1), the common library components had no separate namespace. They took on the namespace of the schema documents in which they were used. This means that a change to the common library affected not just the rest of the common library, but also the business documents.

Common library schema documents follow the same versioning strategy as all other schema documents. Starting from version 2.0, the common library files have their own target namespace: xmlns:eanucc="urn:ean.ucc:2". This namespace includes only the major version but not the minor one, and only backward compatible changes are made in minor versions. Like other schema documents, they use the version attribute on the xsd:schema element to indicate the minor version number.

Common library schema documents have namespaces separate from the business documents that use them, so that they can be versioned separately. Therefore, a change in any of those components is reflected only in the version of those documents where this component is used, not in the whole release.

However, when the common library changes to a new major version, all business documents that use the library change to the new version as well.

Return to Table of Contents

TOP

 
Disclaimer/Copyright | Privacy | Sitemap | Contact webmaster