xmlDocumentToFile()

Stores the internal DOM tree in an arbitrary XML file.

Synopsis

int xmlDocumentToFile(unsigned doc, string fileName);

Parameters

Parameter Description
doc Document ID (returned by xmlNewDocument().)
fileName Absolute path to the file the DOM tree is saved in.

Description

Stores the internal DOM tree in an arbitrary XML file.

Example

#uses "CtrlXml"
main()
{
  string err;
  int errLine, errColumn, DoF;
  uint node, docNum;
  DebugN(docNum = xmlDocumentFromFile("D:/XmlTest0.xml", err,
  errLine,
  errColumn));
  /* Copies the content of the XmlTest0.xml file into the
  XmlTest1.xml
  */
  DebugN("Error in xmlDocumentFromFile:", err, errLine,
  errColumn);
  DebugN(DoF = xmlDocumentToFile(docNum,"D:/XmlTest1.xml") );
  DebugN("xmlDocumentToFile D:/XmlTest1 successful:", DoF);
}

Assignment

XML Control Extension

Availability

CTRL. In every script where the "CtrlXml" extension (#uses "CtrlXml") is used.