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

General picture: how to use the XML standard

Return to Table of Contents

Prerequisites for using XML

The use of the XML standards requires certain software tools. In the simplest case, these are an XML processor and validator.

The XML processor is usually included in the application used to view the XML document. It verifies whether the XML file is well formed, which means that it follows all the rules defined in the W3C recommendation for XML syntax.

The validator checks whether the XML instance document conforms to the XML schema. XML schemas contain definitions and structures which can be used in XML instance documents. The instance documents contain the actual data with their respective tags in the form of elements and their attributes. Validating software compares the instance document to its schema. This includes checking that the document contains only legal tags, if the data conforms to the format specified in the schema, whether the structure of its content is correct, etc. One schema can define multiple data representations, contained in different XML instance documents. However, the content of all those documents must remain within the limits and restrictions specified in the schema.


Validating different instances of XML business documents with one schema

Validation can be used in business scenarios, where each of the trading partners involved in the data exchange holds a copy of a standard schema and validates each instance document sent or received. Of course, there have to be separate schemas for each type of business document, as they all have different content and structure, e.g. Order, Despatch Advice, Invoice, etc. Documents that are not valid (do not conform to the respective schema) are rejected. At the sender's side, the validating software should be installed at the document generation point. Thus, each business message is validated and the possible errors can be corrected before sending.


Validating XML documents at the sender's side

At the receiver's side the validation takes place in the receiving point of the exchange software, before any data is transmitted to the users' business application.


Validating XML documents at the receiver's side

Usually, the XML tools combine the functionalities of parsing (extracting data and tags from the native XML document), editing, checking well-formednes and validating in one software unit, but there are also a number of self contained validators and editors. For more information refer to the XML Tools.

TOP

GS1 set of XML standards

GS1 produces several work products as part of it’s standards for implementation. Two of those work products are schemas and Business Message Standards or BMS.

Message standards allow users to convert business documents into a format that can be electronically exchanged. XML business documents are referred to as “messages”, or “documents”, and their format is defined in the GS1 XML data format message standards. The exchange of these business documents is a component of the overall e-Commerce.

GS1 Schema describes the structure of an XML document. The purpose of an XML Schema is to define the legal building blocks of an XML document,
GS1 schema design allows developers to supply information embedded within XML documentation.

GS1 XML Standards are an organized suite of XML Schema Modules. The current release is an architecture upgrade from the previous version. The changes have been incorporated to take full advantage of all the features of XML Schema specifications.

Business Message Standards are the artefact of the GSMP that documents the formally approved standards for a business message. Each Business Message Standard brings together the appropriate classes, attributes, and values needed to fulfil the message objective. Specific definitions are provided to ensure clarity around class, attributes, and values. Syntax constraints are identified. The standard also includes the high level and detail level class diagrams depicting the scope of the message, and the relationship of its elements to each other. These diagrams allow parties to see data relationships and to determine where and how to interface extensions to fulfil a business function. Each standard contains a series of extracts from the Global Data Dictionary. Relevant attribute items within a specific class name are presented, identified by type and use.

The GS1 XML standards are published as a set of documents per business message. Users need to download all of those documents to implement a given message. Those documents include:

Implementers packet

The implementer’s packet is a ZIP file, comprised of all the XML files necessary for validating a given XML message. It consists of:

  • TableofContents.txt – a text file listing all the files included in the given packet
  • Instance File folder, containing one (out of many possible) sample XML file for the message
  • HTML Sample folder, containing the HTML representation of the sample XML file from the Instance File folder
  • Schemas folder, with the following content:
    • EAN.UCC folder – contains two subfolders:
      • Common – includes schemas from the common library, with the target namespace: xmlns:eanucc="urn:ean.ucc:2". These are files that can be reused in many business documents, in any context
      • [Business Process Area name] – includes schemas from the particular business area that are necessary to validate the given business message. These schemas have the target namespace:
        xmlns:[context-specific prefix]="urn:ean.ucc:[context value(s)]:2"
        For more details see Context and Versioning
    • SBDH folder – contains the Standard Business Document Header schemas
    • Proxy schema – for the particular business message

Business Message Standard (BMS)

This is the document containing Business Solution Document (BSD) for the given message and the full UML model of the message.

The Global Data Dictionary report lists all the message model components (classes, role names, enumerated values and attributes), their definitions, cardinality, data field length and the title of the XML schema, where those components are defined.

The purpose of the Business Message Standards is to provide the necessary information to implement a particular message as a part of the GS1 System.

TOP

Mapping from UML to XML

The GS1 XML standards are developed based on UML Class Diagrams. A Class Diagram is mapped into an XML Schema or Schemas. Afterwards, a sample XML file is developed, complying to data structures defined in the schema and data definitions from the Global Data Dictionary. The Class Diagrams with the model description and the sample XML file are then used to create the Business Message Standard, published together with the set of schemas.


The general picture of GS1 XML standards development

The actual mapping of the specific components of UML to XML is driven by the XML syntax constraints and the chosen schema design model. However, some general rules are applied whenever it is possible (exceptions from those rules are rare and caused by the syntax constraints). The user does not have to understand all the details and complexities of UML to XML mapping, but the basic familiarity of key principles can be helpful in reading the GS1 standards.

The basic rules for mapping of UML components to XML can be illustrated by the three examples below:

Example 1
Mapping of UML components as XML Complex Types and Elements

Example 2
Mapping of UML components as XML Simple Types and Attributes

Example 3
Mapping of UML components as XML Choice

Return to Table of Contents

TOP

 
Disclaimer/Copyright | Privacy | Sitemap | Contact webmaster