XML Output

From CometWiki

(Difference between revisions)
Jump to: navigation, search
(Building page)
m (minor)
Line 9: Line 9:
<td><b>Syntax:</b>
<td><b>Syntax:</b>
-
<td>!
+
<td>
 +
!
  ! order line item file
  ! order line item file
  !
  !

Revision as of 17:39, 17 May 2010

Introduction

XML stands for eXtensible Markup Language.

XML is a widely used scheme that allows data to be transmitted from one application to another without regard to how the applications were written.

In a way similar to Comma Delimited Files, XML files may be written using a modified Format statement.

Syntax:
!
! order line item file
!
OrderLine: Format _
"<order line>";_
olord$, "order Number";_
ollin$, "line Number";_
olitm$, "bill code";_
oldsc$, "description";_
olum$, "unit of measure
olord, "qty ordered";_
olshp, "qty shipped";_
olbo, "qty b/o";_
olprc, "unit price";_
"</order line>"
...
File(LUN)XML        ! Write to this file in XML Format
...
Write(LUN,OrderLine)
Discussion:

Each XML data item (called an Entity), is composed of a name and a value. It looks like this: <name>value</name>. When indicated by the file statement above, Comet32 will treat a format statement differently than when specifying normal data output. The section of a format specification normally used for the edit mask is now treated as the item name. The item values are blank stripped and escaped according to XML specifications.

Items with no name fields are output literally. That gives you the ability to surround the data items in the format with a group name as above.

If the field is a string and it is empty, Comet will treat the item as an empty entity "<name/>".


Personal tools