Skip to content

XML Syntax

The following is an overview of the XML syntax used by the TS XML DataServer.

XML syntax is used to describe data using simple <tag>value</tag> pairs. The tags identify an element of data, its corresponding value, and the relationship of xml-elements within the XML structure.

Unlike HTML syntax, XML syntax rules are strictly enforced:

  • Each tag element must terminate in a closing </tag>.
  • All tags must be properly nested.
  • Tags and their values are case sensitive.

The following xml-element identifies a piece of data as data-name CUST-CODE with a value of 100101:

<CUST-CODE>100101</CUST-CODE>

The contents of an XML string passed to and returned by the TS XML DataServer will vary depending upon the XML request. For the purpose of this documentation a sample XML string returned by a READ schema-name is used as an example.

The XML string starts with the XML declaration (header) containing the XML version and encoding. This is the only XML tag that does not include a closing tag.

<?xml version="1.0" encoding="ISO-8859-1"?>

The root XML element contains the string literal “<XMLSource_” followed by the XML source name. The XML source name identifies the Dictionary-IV XSchema or Link definition used to process the XML request.

<?xml version="1.0" encoding="ISO-8859-1"?>
<XMLSource_OEFSCM01>
</XMLSource_OEFSCM01>

Nested below the root element is the Link name used to read the data. The Link name identifies the data source and is repeated for each data set (record).

Example:

<?xml version="1.0" encoding="ISO-8859-1"?>
<XMLSource_OEFSCM01>
<OELCUST>
<data-name>data</data-name>
<data-name>data</data-name>
</OELCUST>
<OELCUST>
<data-name>data</data-name>
<data-name>data</data-name>
</OELCUST>
</XMLSource_OEFSCM01>
<?xml version="1.0" encoding="ISO-8859-1"?>
<XMLSource_OEFSCM02>
<OELCUST>
<data-name>data</data-name>
</OELCUST>
<OELSLRP>
<data-name>data</data-name>
</OELSLRP>
<OELINVH>
<data-name>data</data-name>
</OELINVH>
<OELINVD>
<data-name>data</data-name>
</OELINVD>
<OELINVN>
<data-name>data</data-name>
</OELINVN>
</XMLSource_OEFSCM02>

The data-names are the Format data-element names associated with the Link definition.

Example:

<?xml version="1.0" encoding="ISO-8859-1"?>
<XMLSource_OEFSCM01>
<OELCUST>
<CUST-CODE>data</CUST-CODE>
<CUST-NAME>data</CUST-NAME>
</OELCUST>
<OELCUST>
<CUST-CODE>data</CUST-CODE>
<CUST-NAME>data</CUST-NAME>
</OELCUST>
</XMLSource_OEFSCM01>

The following XML string is returned when a XML READ XSchema definition for OEFSCM02 is completed.

<?xml version="1.0" encoding="ISO-8859-1"?>
<XMLSource_OEFSCM02>
<OELCUST>
<CUST_CODE>100100</CUST_CODE>
<CUST_NAME>Toot-Your-Horn</CUST_NAME>
<CUST_STATE>TX</CUST_STATE>
<CUST_CITY>Port Lavaca</CUST_CITY>
<CUST_PHONE>555-2341</CUST_PHONE>
<SR_CODE>AF</SR_CODE>
<OELSLRP>
<SR_NAME>Albert Fisher</SR_NAME>
</OELSLRP>
<OELINVH>
<INV_NUM>000001</INV_NUM>
<INV_DATE>07/16/05</INV_DATE>
<INV_AMOUNT>313.85</INV_AMOUNT>
</OELINVH>
<OELINVD>
<INV_LNUM>02</INV_LNUM>
<INV_QTY>1</INV_QTY>
<INV_LTAX>.10</INV_LTAX>
<INV_LEXTEN>1.40</INV_LEXTEN>
<ITEM_CODE>10-100-000</ITEM_CODE>
<INV_LPRICE>1.40</INV_LPRICE>
<INV_DISC>30.00</INV_DISC>
</OELINVD>
<OELINVN>
<ITEM_DESC>Little nails</ITEM_DESC>
</OELINVN>
<OELINVH>
<INV_NUM>000016</INV_NUM>
<INV_DATE>07/31/05</INV_DATE>
<INV_AMOUNT>5021.29</INV_AMOUNT>
</OELINVH>
<OELINVD>
<INV_LNUM>02</INV_LNUM>
<INV_QTY>16</INV_QTY>
<INV_LTAX>1.57</INV_LTAX>
<INV_LEXTEN>22.40</INV_LEXTEN>
<ITEM_CODE>10-100-000</ITEM_CODE>
<INV_LPRICE>1.40</INV_LPRICE>
<INV_DISC>30.00</INV_DISC>
</OELINVD>
<OELINVN>
<ITEM_DESC>Little nails</ITEM_DESC>
</OELINVN>
<OELINVH>
<INV_NUM>000031</INV_NUM>
<INV_DATE>08/15/05</INV_DATE>
<INV_AMOUNT>9728.78</INV_AMOUNT>
</OELINVH>
<OELINVD>
<INV_LNUM>02</INV_LNUM>
<INV_QTY>31</INV_QTY>
<INV_LTAX>3.04</INV_LTAX>
<INV_LEXTEN>43.40</INV_LEXTEN>
<ITEM_CODE>10-100-000</ITEM_CODE>
<INV_LPRICE>1.40</INV_LPRICE>
<INV_DISC>30.00</INV_DISC>
</OELINVD>
<OELINVN>
<ITEM_DESC>Little nails</ITEM_DESC>
</OELINVN>
</XMLSource_OEFSCM02>

From the TS XML DataServer Reference, version 8.9.1. Open this page in the PDF