Method XmlNode():toString() Foundation

Returns the XML representation for a node.

:toString( [<lNodeOnly>] ) --> cXML
Specifies whether only the current XmlNode() object and its attributes is written to the return string. If .T. (true) is passed, only the current XMLNode object is written. Passing .F. (false) causes the XMLNode object and all child nodes to be written to the returned string. The <lNodeOnly>parameter is optional and defaults to .F.

A character string with the XML representation of the XmlNode() object and possibly its child nodes.


The method :toString() can be used to retrieve the XML representation of a node object or node object hierarchy. Unlike :toXML()which returns a valid XML document or fragment when executed on the document node, :toString() only operates on element nodes. When the node object is a document node, :toString() returns the XML representation of the first child of the document.

The nodes in the return string are indented to reflect the document's node hierarchy. The indentation used by :toString() to do this can be changed via the method :setDefaultIndentation().


If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.