DEFINE_XML_TEMPLATE

Syntax

DEFINE_XML_TEMPLATEtemplate name’ ‘name space’ ‘include nature’ ‘element name1include nature’ ‘element name2’ ‘...’ ‘include nature’ ‘element name3END_XML_TEMPLATE

Description

Use the DEFINE_XML_TEMPLATE command to define the structure of XML. You can have an XML template within another or even copy its content.

Parameters

The following table lists and describes the parameters:

Parameter Description

Template name

Specify a unique identifier of an XML structure.

Name space

Specify the name space to be used with the XMLNS attribute. Use default if no private name space is used. Multiple name spaces can be specified delimited by “,”.

Example: default:ABC,root:PSQR,child:XYZ

Include nature

Specify the nature of the element in the XML template.

  • ADD_ELEMENT: Use this to add the default value of an element to a record.

  • ADD_ELEMENT_FORCE_EMPTY: Use this to add elements that were not initialized to the XML file.

  • ADD_AS_CHILD: Use this to add another XML template as child.

  • INHERIT_ELEMENTS: Use this with the element_name template. This copies all the elements in the specific XML template to the current XML template. Duplicate element names and name spaces of the source template are eliminated.

element name

Use this to apply any string value that starts with an alphabetic letter.. Do not use duplicate element names within an XML template in the same name space.

Example

The following example illustrates the DEFINE_XML_TEMPLATE command:

DEFINE_XML_TEMPLATE 'grand_child' 'default'
ADD_ELEMENT 'Column1'
ADD_ELEMENT 'Column2'
END_XML_TEMPLATE