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

Extension mechanism

Return to Table of Contents

General extension component

Beginning from release 2.0, every business document schema contains a placeholder where some additional, context-specific components can be inserted. This placeholder has a form of the XML schema '##any' element.


The structure of the Extension component

The XML 'any' element has a built-in attribute: processContents. It acts as an indicator of how an application or XML processor should handle the validation of XML documents against the elements specified by the 'any' element. In the GS1 extension component, the value of this attribute is set to 'lax', it means that the XML processor attempts to obtain the schema for the required namespaces and validate any element from those namespaces, but if the schema cannot be obtained, no errors will occur.

Validation of the extension components

Although the XML syntax rules for the 'any' element allow any well-formed XML to be placed within the instance file, the users must remember that their business partners will not be able to validate the non-standard information. The message recipient must be provided with the relevant schema validating the extended part of the message. It is recommended to use only the extension attributes approved within the GSMP process. Otherwise, the messages will not be standard and globally interoperable.

However, because the processContents attribute is set to 'lax', the validation of the extension element is optional: an XML schema parser will validate elements for which it can find declarations (extension schemas) and raise errors if they are invalid. If it does not find context specific schemas for a certain set of context specific elements, the parser will not report errors for those elements. The placeholder is an optional element of the root element.

Return to Table of Contents

TOP

 
Disclaimer/Copyright | Privacy | Sitemap | Contact webmaster