Skip to main content
XML - XML Overview
Micah A. Parker avatar
Written by Micah A. Parker
Updated over 2 months ago

Whenever you're working with data going to and from your various applications (such as Transaction Manager, Pack and Ship, or even your ERP) you may run into a common format for transporting data known as Extensible Markup Language (XML).

Within the Foundry platform XML is used heavily to transfer data between your ERP (such as Intuit QuickBooks, Microsoft Dynamics GP, & Microsoft Dynamics NAV), and internal systems (such as Pack and Ship). This format is an easy to understand, efficient format for transporting data between lots of applications and will often be seen.

This article briefly can describe some basics about XML - but we recommend checking out the full covering here

Structure


XML is composed of what is known as a hierarchy - a tree like system that organizes the data by providing a way that can easily be followed by both a person, as well as a computer.

Elements, Values & Attributes

At a base level the XML document is composed of Elements, Values, and Attributes.

Elements

An element is the wrapper used to identify the various pieces of data that is being transported (blue text in the above image). Things such as the Invoice Number, Date, and Item Code are all forms of Elements that define what data is being transported.

The elements of an XML stay the same across each individual file which is how the system knows where to find the data it is looking for in order to determine how many Items there are, what their prices are, or even what Invoice the file is referencing.

Elements are composed of an opening (<Price>) element and a closing (</Price)> element - anything in between is the value. Closing elements contain a forward slash prefixed to the name.

Parent/Child Relationships

In order to form a hierarchy - every Element requires a Parent Element that defines the structure - this is defined by your opening and closing nodes as before, but instead of having a value between them - you place additional elements in between the open and the close as such:

In the above example, Item is your Parent while ItemCode, Price, and Description all are Children of <Item>

Sibling Relationships

A sibling relationship, is two or more elements that reside at the same level as each other. So in the above example - ItemCode, Price, and Description are not only children of Item, but they're also siblings to each other. ItemCode is a sibling to Price, as is Description and vice versa.

Root Element

The Root element is the very first Element that appears within the XML document - it cannot have siblings (otherwise it breaks the root), and it has no parent. In the XML example above - <Invoice> would be the root element because no other elements sit at its level.

Rules

  • Must have open and close node

    • an empty element will have a single node - with a slash at the end: <Price /> would indicate an empty price

  • Elements can have as many children as it wants

Values

A value is the actual data being either inputted or outputted to represent your transaction (white text in image). While <Price> and </Price> indicate what the value is representing, 49.99 is the actual price value being passed through.

Attributes

An attribute is a modifier of an element (grey text in image) - these attributes can help distinguish between two different elements that have the same name, while the attribute value (green text in image) can be used for filtering specific elements based on their attributes.

Resources


rev 10/25/22

Did this answer your question?