Write contents of an XML document to an XML string

WTSupported in traditional Synergy on Windows
WNSupported in Synergy .NET on Windows
USupported on UNIX
VSupported on OpenVMS
xml_string = %XML_DOC_TOSTRING(document[, format])

Return value


The XML string that contains the serialized XML document. (XML_STRING_TYPE)



The XML document instance to serialize. (XML_DOC_TYPE)


(optional) If this argument is passed, the XML string is formatted with a line feed (LF) between the lines. (n)


%XML_DOC_TOSTRING creates and returns an XML string that contains an entire XML document. You can then retrieve the Synergy memory handle for that string using %XML_STRING_GETHANDLE.

You can alternatively serialize an XML document into an XML file using %XML_DOC_TOFILE.

Strings created with %XML_DOC_TOSTRING should be deleted using %XML_STRING_DELETE when you’re done with them.


When serializing an XML document to a string, %XML_DOC_TOSTRING will not unescape any escaped text or attribute values in the XML document even if %XML_OPTION is set to SYNESCAPE_UNESCAPE.

This function is defined as ^VAL.


See xfspism2xml.zip, available from the Synergy CodeExchange in the Resource Center on the Synergex website.