Initializing help system before first use

save

save


Purpose
Save an XML document.
Synopsis
procedure save(doc:xmldoc, fname:text)
procedure save(doc:xmldoc, n:integer, fname:text)
Arguments
doc 
Document to save
Node number to use as root node (default: 0)
fname 
Destination file name
Example
This example shows the two versions of this procedure.
 declarations
    DB: xmldoc
    Pers: integer
  end-declarations

! Save XML document to file 'results.xml'
  save(DB, "results.xml")

! Display a subtree on screen
  Pers:= getnode(DB, "personnelList/region/employee[@id='T345']")
  save(DB, Pers, "") 
Further information
1. This routine generates an XML file from the provided xmldoc object. The XML header is produced using the properties defined with setencoding, setxmlversion and setstandalone. No header is emitted if either the encoding or the version is an empty string.
2. When providing an alternative root node, only the specified part of the document tree is exported without any XML header.
3. The document is formatted according to the indentation mode and its associated settings (see setindentmode); XML control characters are encoded (see xmlencode).
Related topics
Module