create xml from node(a, b, c, d, e, f, g)

Group

XML


The function creates an XML file based on the node that is specified in the parameter a. If no value is set, the node is used in which the field is with this function. All parameters can be set optionally.

Description of Parameters


Parameter

Description

a

(optional) Name of the node, from which the XML is created from.

b

(optional) true if no XML header should be created. Default: false.

c

(optional) If the memory-safe method used (parameter c = true), elements in the production will be outsourced to the file system. This is the preferred option for larger amounts of data.

d

(optional) When using the memory-safe method (parameter c = true), the threshold value is specified here from being outsourced as many elements in the file system. Default: 1000.

e

(optional) Use namespace inheritance (true or false).

f

(optional) true to also write the whitespaces of field values (even if there are only whitespaces). Default: false.

g

(optional) Replace field names D-_... and F-_... with _... (meaning: cuts off D- and F-).

Parameter Description for XML Handling in the Destination Tree


In order to control the structure of XML elements in the destination tree, properties in the destination node/fields and special fields with reserved suffixes are used.

Properties in Destination Nodes


  • XML Namespace: This property defines a namespace for the element which is created from the node where it is specified, e.g.: soapenv. All elements contained in this node will get the same namespace as long as there is no other namespace set. If no namespace should be set use DEFAULT as value.

  • XML/JSON handling: This property controls the way in which the node is added to the XML. The following settings are possible:

  • Normal: The node is created as an element in the XML.

  • Transparent: The node itself does not generate an XML element, but the content in the node is considered.

  • Exclude: The node is ignored in the generation.

  • Array: (This value is not relevant for this function.)

  • Array Transparent: (This value is not relevant for this function.)

Properties in Destination Fields


  • XML Namespace: This property of the element, which is generated from the field, can be assigned an XML namespace, e.g.: soapenv. You can also define a new namespace in this property. Example: soapenv = http://schemas.xmlsoap.org/soap/envelope/. If no namespace should be set use DEFAULT as value.

Reserved Field Names

Within a node, fields can be created which allow a further control. The following entries are reserved for the field name:


  • _val: A field with this extension contains the value of the XML element.

  • _attr: (e.g.: id_attr) With fields with this extension, attributes can be added to the XML element. In the example would be the attribute id added to the element.

  • _nsdef: (e.g.: xsd_nsdef) In the XML element another namespace (xsd) is defined. The content of the field has to be the namespace, e.g. http://www.w3.org/2001/XMLSchema

  • _name: Sets the name of the XML element in the containing node instead of using the node name as element name.

Examples


In the following example, the four reserved field names were used. The node rootNode is renamed into Envelope in the field Rootnode_name with a fixed value. The three namespaces are defined in the three fields wsdw_nsdef, xsd_nsdef and xsi_nsdef, the namespace soapenv is defined by the attributes of the destination node (see above). The Soap request receives as a fixed value 1 as an attribute in ID_attr. The field item_val gets the values of the XML elements. In field create_xml_from_node the described function is used to create an XML file. The following parameters were set in the example.

Parameter a

Parameter b

Parameter c

Parameter d

Parameter e

Result

Rootnode





See file XMLout.xml

XMLout.xml
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://test.de" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdw="http://tempuri.org/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<soapenv:SoapRequest soapenv:ID="1">
<soapenv:item>0815</soapenv:item>
<soapenv:item>0816</soapenv:item>
</soapenv:SoapRequest>
</soapenv:Body>
</soapenv:Envelope>