What is XML
One of the common data formats that we encounter today is XML. This could be just plane XML, or any of the standardized versions; cXML, ebXML, etc. But there are some basic commonalities between these. And if you haven’t dealt with XML much, you will need to know something about it sooner or later. This post is a brief introduction.
What is XML: XML stands for Extensible Mark-up Language. Unlike Delimited Files, Fixed Width Files or EDI, XML data is defined by Nodes and or Tags. Tags look like this: <TAG>some data here</TAG> and in this way the tags indicate the beginning and ending of the data. Tags have a beginning and and ending tag with the exception of usage like this: <TAG/> that indicates that this tag is just holding the place for a node that has no data, but is required to be present.
Basic Structure of XML files: The basic structure is simple. There are tags . Tags surround data, or other tags. Like this:
<xml>
<header>This is the Header Data</header>
<body>This is the body.</body>
</xml>
Tags are used to define the data that they contain. And by using tags in a hierarchical manger we can have simple definitions for data, that are grouped to create more complex structures. Like this:
<xml>
<sender>
<name>
<first>John</first>
<last>Doe</last>
<middle>C</middle>
</name>
<address/>
</sender>
</xml>
We could have done this:
<xml>
<senderFirstName>John</senderFirstName>
<senderLastName>Doe</senderLastName>
<senderMiddleName>C</senderMiddleName>
<xml>
But this seems like an odd way to do it. By having a tag that is just <name> we can define the definition for that tag once, and then everywhere we use <name> we know there can be a <first> <last> and <middle> that contain text. And we can reuse name not only for the sender, but in other places as well. The definition for the tag can be held in a DTD or Schema document that defines the structure and contents of the XML file. The DTD or Schema document lets a parser or validator know how to read the file, and what tags contain numbers, text, currency, etc. We’ll get into DTDs and Schemas more in a later post.
Types and Usage
We mentioned a couple of types of XML. XML itself can be freely defined just like a flat file. There is no body of standards for XML like there is on X12 EDI. You can make up your own format and tags for your XML files as you go along, and in the way that best fits your business processes and data storage needs.
And with this you need to understand what XML does. XML doesn’t do anything. It just stores data. HTML, another “Mark-up Language” does something. It presents data. But XML does not, it only stores the data. (Just like a flat file or EDI file. They just sit and hold the data that we put into them.) Some XML is used to transport data, but the XML is only the container, it does not do any transport work. Thus creating an ebXML file used to transport data, doesn’t make it go anywhere.
E-commerce
Due to its flexibility, XML and its various versions are getting a lot of attention in the e-commerce world. There is no doubt that used with internal applications, XML can become far superior to Flat File, and standards like X12 EDI. A greater challenge is in its use between companies.
Many supply chain partners have adopted an XML standard, but aren’t able to communicate with people that have a different XML standard. As time goes on, there will be some more solid standards of usage for XML that will help solve this problem. And of course, that well defined standard of XML will no longer be as flexible as XML is today.
Things to know.
- You will need to know the basics of XML, how it works and be able to eveluate if it is a good fit for a solution to your integration challenge.
- XML is called a “human readable format” mostly because the data is structured in tags that use english. Thus you don’t have to have the standard memorized or handy to find phone numbers, names and prices where they are in tags like <phoneNumber>, <name> and <unitPrice>.
- XML is not a slim format. Using Tags as structure and delimiter makes data bigger, and sometimes makes it look more complex that it would in a simple set of rows.
Subscribe to "The Integration Engineer" by Email
Find out about the tools and services available at The Integration Engineer's Consulting site.











