Popular items

 

What is the use of namespaces in XML?

Blogpost by: Han Otten
From: Friday 10 April 2015

Namespaces are often experienced as difficult, troublesome and dysfunctional. We think quite differently about that.

Some examples:

A company has multiple locations, which have different versions of an ERP system. All these systems generate XML business messages with the same root element, but a slightly different XML scheme. These differences can be distinguished by giving the different versions a private namespace. You can also differentiate the type of message (order, packing slip, etc.), by using the namespace.

The namespace in XML schemes can be used to distinguish different template libraries.

For example you have an order, order response, dispatch advice and invoice schedule. All these schedules have a customer object, in which the customer code (with us GLN) and address information is defined. Without namespace you should redefine these elements per message. For example the definition of GLN is 13 characteristics long, only numeric values, etc. By including the GLN in a scheme with a namespace, you can use it in the other schemes. The scheme with the common elements, the librarie, can then be included in the other schemes by using an ‘include’.

Another good example of this is the UBL messages set. Between the standard UBL and the NL taxonomy version are different values of amounts. Again, the different versions are differentiated using the namespace.

Also data sources with the same XML layout can be differentiated using the namespace.

Instead of hard, difficult and obstructive; the namespace is a powerful tool to manage our messaging smoothly!

 

« Back to Blogs
Tags: Namespace, XML

Han Otten

Integration Consultant

» More information

Add your reply

Reactieformulier

They chose Onetrail