.. highlightlang:: us .. index:: xml_save_node .. _xml_save_node: xml_save_node ============= .. us.tag xml_save_node NOTREADYENGLISH XML New5200 Changed5505 :ref:`xml_save_node` saves a UniScript object as an XML file. .. function:: bool = xml_save_node(oXML, ssFileName) bool = xml_save_node(oXML, ssFileName, nFormatted) ssXML = xml_save_node(oXML, "", nFormatted) .. us.return **Return Value** *bool* is TRUE (1), if the function was successful and otherwise FALSE (0). If *ssFileName* is an empty string, the function returns the XML code as a sting instead of writing *oXML* into a file. .. us.params **Parameters** .. uparam:: oXML *oXML* is a special formatted UniScript object (see Comment). .. uparam:: ssFileName *ssFileName* is the file name, e.g. ``"c:\\test\\text.xml"``. .. uparam:: nFormatted .. list-table:: :header-rows: 1 * - Value - Description * - 0 - Output without new line characters. New lines are only added to text elements. (Default) * - 1 - New line characters and indentation with two spaces. .. us.comment **Comment** The object *oXML* must have the following structure:: oXML = [. [1] = "text node" [2] = oXML_other [N] = ... attr = [. name=ssValue, ...] name = "element-name" ] .. us.example **Example** .. include:: ../include/test_xml_save_node.ic .. us.history **History** .. list-table:: :header-rows: 1 * - Version - Description * - R2013.5 - If *ssFileName* is an empty string, the function returns the XML code as a sting instead of writing *oXML* into a file. * - 5.20 - New. .. seealso:: :ref:`Overview-XML`, :ref:`text_file_read`, :ref:`xml_parse_string`, :ref:`xml_esc` :sub:`id-1241474`