XML Header & Footer
The structure of a typical XML document can be broken down into three primary sections, Header, Body and Footer. The Header and Footer sections normally contains static information which rarely varies between individual transactions. The Body section normally contains more volatile information relating to the individual business transaction.
The XML Header and Footer Maintenance is an optional configuration to assist in the development of Outbound mapping programs by allowing the maintenance of the Header and Footer sections. This aids development by allowing the configuration of the static information within ECS/integrating email, meaning that the Business Application based mapping program need only map the Body section of the XML Document.
The following example demonstrates how this principle works with a sample XML Order:
<?xml version ="1.0"?>
<!-- ECS/XML -->
<Document>
<header>
<delivery>
<message>
<messageID>XML_Order</messageID>
<sent>2002-02-20T18:22:51+01:00</sent>
<subject>XML Sample Order</subject>
</message>
<to>
<address>customer.services@xyz.com</address>
</to>
<from>
<address>purchasing@xxx.com</address>
</from>
</delivery>
</header>
<body>
<Order>
<OrderHead>
<OrderType>Purchase Order</OrderType>
<OrderCurrency>
<Currency Code="EUR">Euro</Currency>
</OrderCurrency>
</OrderHead>
<OrderReferences>
<BuyersOrderNumber>181853</BuyersOrderNumber>
</OrderReferences>
<OrderDate>2002-02-20</OrderDate>
<Supplier>
<Party>XYZ Supplies Ltd</Party>
<Address>
<AddressLine>Alphabet House</AddressLine>
<AddressLine>1 The Loop</AddressLine>
<City>Birmingham</City>
<State>Midlands</State>
<PostCode>B19 1DS</PostCode>
</Address>
</Supplier>
<Buyer>
<Party>ECS Limited</Party>
<Address>
<AddressLine>Commerce House</AddressLine>
<AddressLine>London Road</AddressLine>
<City>Horsham</City>
<State>West Sussex</State>
<PostCode>RH13 9WJ</PostCode>
</Address>
</Buyer>
<OrderLine>
<LineNumber>1</LineNumber>
<Quantity>
<Amount>3</Amount>
</Quantity>
<Product>
<ItemCode>PEN</ItemCode>
</Product>
</OrderLine>
<OrderLine>
<LineNumber>2</LineNumber>
<Quantity>
<Amount>6</Amount>
</Quantity>
<Product>
<ItemCode>INK</ItemCode>
</Product>
</OrderLine>
</Order>
</body>
</Document>
The RED section represents the Header text which can be configured within the XML Event Header Maintenance.
The BLUE section represents the XML Document Body text which is generated by a user developed Business Application specific mapping program. .
The GREEN section represents the Footer text which can be configured within the XML Event Footer Maintenance.
The configuration of XML Event Header and Footer is optional. This information can be written with the same user developed Business Application Mapping program that writes the Body text, if preferred.
The Header and Footer can contain specific volatile information, such as Date, Time and retrieve certain key values from the ECS/XML Processor Control file. The insertion of these values is controlled by using the following special values which will be automatically replaced by the ECS/XML Processor when the XML document is generated:
Special Value | Replacement Value | Example |
&YYYY | Current Year with Century | 2003 |
&YY | Current Year | 02 |
&MM | Current Month | 12 |
&DD | Current Day | 31 |
&HOUR | Current Hour | 12 |
&MIN | Current Minute | 59 |
&SEC | Current Second | 59 |
&XCGUI | Unique Identifier from IEXC.XCGUI | 021231125959001 |
&XCOGUI | Original Unique Identifier from IEXC.XCOGUI | 021231125959001 |
&XCAREF | Application reference from IEXC.XCAREF | PO1001 |
&SID | Sender Id retrieved from XML Event | ECS |
&RID | Receiver Id retrieved from XML Event | XYZ |
Example: The previous XML Order example contained the following element in the Header (RED) section which requires the generation date, time and time zone:
<sent>1999-01-02T19:00:01+02:00</sent>
This element would be defined within the XML Event Header definition as:
<sent>&YYYY-&MM-&DDT&HOUR:&MIN:&SEC+02:00</sent>
To configure an XML Element Translation, perform the following:
.
<<<<< Back to ECS/XML Menu <<<<<
Copyright © 1998-2003 Electronic Commerce Solutions All rights reserved.
ECS/integrated email & ECS/ie are trademarks of Electronic Commerce Solutions, Ltd. Other brand names and product names used in this document are the trademarks and trade names of their respective holders and may be registered.