%XML_ToString function


Function
The function converts an XML document to a text string.
Declaration
TEXT %XML_ToString(
  INT in handle,
 [TEXT in encoding = "utf-8"]
 [BOOL in useProcInstruction]
 )
Parameters
handleHandle to an open XML document.
encodingEncoding that will be displayed in the procedural instruction <?xml version="1.0" encoding="xxx"?>.
useProcInstructionDisables the displaying of procedural instruction <?xml version="1.0" encoding="xxx"?>.
Return value
Text representation of the XML document.
Description
The function converts the open XML document to text string.
Example
 INT _handle, _element, _node
 TEXT _text
 
 _handle := %XML_CreateDocument()
 _element := %XML_AddElement(_handle, "element")
 _node := %XML_AddTextNode(_element, "value")
 _text := %XML_ToString(_handle)
 
 ; content of the variable _text
 ; <?xml version="1.0" encoding="utf-8"?<element>value</element> 
 
 _text:= %XML_ToString(_handle,"",@FALSE)
 
 ; content of the variable _text
 ; <element>value</element>
Napíšte komentár