xmlWriterSetIndent

SYNOPSIS

int xmlWriterSetIndent(xmlWriter writer, int indent
                           [, string indentString])

Parameters:

  • writer - the xmlWriter

  • indent

    • 0 (default) - do not indent

    • 1 - indent output

  • indentString (optional) - What string to use for indenting. The default is a single space.

Returns:

  • 0 - success

  • -1 - error


DESCRIPTION
xmlWriterSetIndent() sets writer to automatically apply line breaks and spaces between XML elements to give an indented structure to the XML file.

Note that all spaces between XML elements are significant and technically doing this changes the contents of the XML file (see the xmlTree Text Nodes and Children (here) for details).


EXAMPLE

<$ret = (xmlWriterSetIndent($writer, 1, '    '))>


SEE ALSO
xmlWriterNewToFile, xmlWriterNewToString, xmlWriterStartDocument


Copyright © Thunderstone Software     Last updated: Apr 15 2024
Copyright © 2024 Thunderstone Software LLC. All rights reserved.