Re: [xml] Setting serialize() indent level...



On Fri, Jan 30, 2004 at 02:51:17PM +1100, Malcolm Tredinnick wrote:
Hi Stuart,

On Fri, 2004-01-30 at 13:47, Stuart Hungerford wrote:
When serializing libxml2 node or document objects I can set the
"format" parameter to ensure the serialized output is nicely
indented.

Is there some way to set the number of spaces used for indenting
(e.g. 4 spaces instead of the default two)?

There is a global variable, xmlTreeIndentString (a const char*) that you
can set to a string containing the number of spaces you want to indent.

One example of its use is in xmllint.c.

  Try to avoid using the global variables.
Use specialized functions instead like xmlDocFormatDump()

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]