XML.Export

Previous Next

Exports data to the USoft XML single-table format on the basis of a SELECT statement.

Syntax

INVOKE XML.Export WITH
SELECT      { parameter-assignment | column-expression } ...
FROM        table
ORDER BY    order-by-list

 

parameter-assignment  ::=  value  parameter

 

column-expression     ::= 

 

  {    column        |

       OLD( column ) |

       *             |

       OLD( * )      }

The required SELECT clause must contain at least 1 item. Each item in this clause is either a parameter-assignment or a column-expression.

Each parameter-assignment is a value-name pair. The SECOND element is the name of a parameter. The FIRST element is the value assigned to that parameter. Please find values and parameters in the table below.

Each column-expression is either a literal column name or the SQL * (asterisk) wildcard. The OLD() function is supported. Other SQL functions than OLD() are NOT supported.

It is customary, but not mandatory, to list value parameter pairs before column expressions. The order of the items in the SELECT clause determines the order of the attributes in the XML output. The optional ORDER BY clause determines the document order of the records in the XML output.

The required FROM clause must contain the name of exactly 1 table or logical view.

Example

INVOKE    XML.Export WITH 
SELECT    'yes'  UseIOFormats
,         * 
FROM      tour

Parameters

This table lists all value-parameter pairs supported in the SELECT output-lists passed to XML.Export. The use of each parameter is optional. If you do not specify a given parameter and it has a default value corresponding to it, this is the value applied.

Both values and parameter are case-insensitive.

value

parameter

Description

{ yes | no }

AppendToFile

Value is a string and must be quoted, as in the example earlier in this help topic.

 

This parameter is used with the "WriteOutputTo" parameter. If you specify 'yes' for this parameter, the file is appended to. Otherwise, it is overwritten.

{ yes | no }

ConvertWhiteSpaces

Value is a string and must be quoted, as in the example earlier in this help topic.

 

If you specify 'yes' for this parameter, then tab characters, spaces, newline characters and carriage returns/line feeds are converted to 	   
 and &#xD respectively. When the resulting XML document is imported using XML Import, the converted values are switched back into tab characters, spaces, newline characters and CR/LFs.

header-line-name

DTDName

This parameter is used to specify a header line in the XML output with a DOCTYPE declaration containing the DTD Name as reference. See "Document Type Definition (DTD) Specification" for more information.

{ yes | no }

EmptyDocOnZeroRows

Value is a string and must be quoted, as in the example earlier in this help topic.

 

If set to 'no' (the default), if the SELECT statement of the XML export does not return any rows, USoft returns an empty string. This makes it difficult to apply any transformation on the result of the XML export.

 

If set to ‘yes’, then the output is always an XML document. If no rows are returned, this XML document contains only a root tag with the same name as the info window name.

{ Insert | Delete | Update }

ExecutionType

Value is a string and must be quoted, as in the example earlier in this help topic.

 

Specifies a sub element that will be generated for each resulting row element. This way you can generate XML output with specifications for import actions.

{ yes | no }

LeadingZeroForDecimal

Value is a string and must be quoted, as in the example earlier in this help topic.

 

If you specify 'yes' for this parameter, numeric values returned from the database without a leading zero, such as '.30', will appear in your XML result with a leading zero, as in '0.30'.

If you specify 'no', they will appear without leading zero, as in '.30'.

{ yes | no }

UseIOFormats

Value is a string and must be quoted, as in the example earlier in this help topic.

 

If you specify 'yes' for this parameter, column values in the resulting XML output get the IO format of the corresponding domain. Otherwise they are written as they are retrieved from the database.

USFile-alias

output-file-name

WriteOutputTo

This parameter is used to specify that the output is to be written directly to a file. It is possible to use a file which has previously been opened using the USFile.Open method. To do this, the alias used in the USFile.Open method must be specified, preceded by 'USFile.' If no USFile alias is specified, the XML will be written directly to the file specified. If the file exists, it will be overwritten. To prevent this, use the 'Append' parameter. If specified, the method will return the file name.

{ yes | no }

XmlDeclaration

Value is a string and must be quoted, as in the example earlier in this help topic.

 

If you specify 'yes' for this parameter, the default Rules Engine encoding is returned in XML processing instructions. Otherwise no encoding processing instruction is added to the returned XML document.