Re: [xml] Re: xmlIndentTreeOutput = 1??



On Tue, Nov 02, 2004 at 01:40:52PM +0100, Thomas Rokohl wrote:
ok, i understand the problem so i try do make a workaround in my project.
i use more than one xml file and in one of them i will use 
xmlKeepBlanksDefault(0) and in
the other xmlKeepBlanksDefault(1).

so each function which use libxml looks now like this:

void functionA() {
int old = xmlKeepBlanksDefault(0);
...
xmlKeepBlanksDefault(old);
}

  Do not use the global variables !
Use the new APIs xmlReadxxx like xmlReadFile and pass XML_PARSE_NOBLANKS
as one of the options instead.

my project create the xmltree by it self if the file not exist.
and now i have the effect that if the file will be create there is no 
indent.
if i read the file a second time an write in again -> it have indent?!

i also try to make

xmlKeepBlanksDefault(0)
xmlSaveFormatFileEnc(filename.c_str(),doc,"UTF-8", 1);
xmlKeepBlanksDefault(1)

but it not work.

so my question is: to which functions xmlKeepBlanksDefault have affection ??

  Do not touch xmlKeepBlanksDefault, it's the best.

Daniel

-- 
Daniel Veillard      | Red Hat Desktop team http://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]