Home Search

DriveWorks Pro 22
SppConvertTabletoXml

Send Feedback

SppConvertTabletoXml

This function converts a table array into Xml.

Syntax

SppConvertTabletoXml([Table Array])

Where:

Table Array is the array (such as the data in a simple table or the result of a QueryDataValues function) to be converted to a HTML table.

Examples

RuleMeaning
SppConvertTableToXML(DwLookupOfficeSupplies)Will convert the table Office Supplies into XML.
SppConvertTableToXML({"Item","Price","Quantity";"HB Pencil","0.60","3"})Will convert the given array into XML.

Escaping Characters

The following are escaping characters and, if they exist in the table array, will be converted in the result:

CharacterReplaced With
<&lt;
>&gt;
&&amp;

Example DriveWorks Table

The table OfficeSupplies contains the following data:

ItemPriceQuantity
HB Pencil0.603
2B Pencil0.602
Black Biro0.801
Rubber1.501
HB Pencil0.602
Black Biro0.801

Result as XML

The table above will result in the following XML:

The values:

XMLversion and XMLencoding below will be replaced with the current version and encoding values.

For example:

XMLVersion will be 1.0

and

XMLencoding will be utf-16

<?xml version="XMLversion" encoding="XMLencoding"?>
<Table>
  <Row>
    <Column>Item</Column>
    <Column>Price</Column>
    <Column>Quantity</Column>
  </Row>
  <Row>
    <Column>HB Pencil</Column>
    <Column>0.60</Column>
    <Column>3</Column>
  </Row>
  <Row>
    <Column>2B Pencil</Column>
    <Column>0.60</Column>
    <Column>2</Column>
  </Row>
  <Row>
    <Column>Black Biro</Column>
    <Column>0.80</Column>
    <Column>1</Column>
  </Row>
  <Row>
    <Column>Rubber</Column>
    <Column>1.50</Column>
    <Column>1</Column>
  </Row>
  <Row>
    <Column>HB Pencil</Column>
    <Column>0.60</Column>
    <Column>2</Column>
  </Row>
  <Row>
    <Column>Black Biro</Column>
    <Column>0.80</Column>
    <Column>1</Column>
  </Row>
</Table>