xmlTreeSaveDoc

SYNOPSIS

int xmlTreeSaveDoc(xmlDoc doc, string filename,
                       [, string encoding] [, string options])

Parameters:

  • doc - the xmlDoc to be saved to a file.

  • filename - the file to save doc to

  • encoding (optional) - the character encoding to use. Default is UTF-8.

  • options (optional) - the options to use when saving (see below)

Returns:

  • the number of bytes written, or -1 in the case of error.


DESCRIPTION
xmlTreeSaveDoc() writes the XML document doc to the file filename.

The possible values for options are:

  • INDENT - add extra whitespace text nodes to indent the output. See xmlTreePrintDoc() for examples.


EXAMPLE

<$numBytes = (xmlTreeSaveDoc($doc, 'output.xml'))>


SEE ALSO
xmlTreePrintDoc


Copyright © Thunderstone Software     Last updated: Oct 24 2023
Copyright © 2024 Thunderstone Software LLC. All rights reserved.