ComposeXML()

Syntax

Result$ = ComposeXML(#XML [, Flags])
Description
Returns the XML tree as markup in a single string. The XML will be returned in the string format of the executable (Ascii or Unicode) independent of the setting returned by GetXMLEncoding(). The ExportXML() function can be used to create markup in a different encoding.

Parameters

#XML The XML to export.
Flags (optional) It can be a combination of the following values (with the '|' operator):
  #PB_XML_StringFormat : Includes a byte order mark. See WriteStringFormat() for more information.
  #PB_XML_NoDeclaration: Does not include the XML declaration.
Note: According to the XML specification, the XML declaration can only be omitted if the document is encoded in UTF-8 or UTF-16 or if the encoding information is provided externally through a transfer protocol for example. Even then, it is advised to keep the declaration in the document.

Return value

Returns the markup as a string.

Remarks

The created XML markup is not reformatted. It is returned as it was initially parsed/created. The amount of newline/whitespace written between the tags is stored in the 'text' of each XML node. (see GetXMLNodeText() for more information) To reformat the XML markup before saving, the 'text' for each XML node can be altered or FormatXML() can be used to apply some common reformatting options to the tree.

See Also

FormatXML(), ExportXML(), SaveXML()

Supported OS

All

<- ChildXMLNode() - XML Index - CopyXMLNode() ->