[xml] [PATCH][RESEND] xmlIndentTreeOutput and xmlKeepBlanksDefault()
- From: Nick Wellnhofer <wellnhofer aevum de>
- To: xml gnome org
- Subject: [xml] [PATCH][RESEND] xmlIndentTreeOutput and xmlKeepBlanksDefault()
- Date: Wed, 29 Jul 2009 18:44:06 +0200
I didn't get a reply when I sent this to the list about 6 months ago. I
still think this is an issue. See also this post from 2003:
http://mail.gnome.org/archives/xml/2003-May/msg00137.html
My original mail follows:
------------------------------------------------------------------
I think the function xmlKeepBlanksDefault() in parserInternals.c should
never set the global variable xmlIndentTreeOutput to 0.
AFAICS its only use is to enable legacy behavior by calling
xmlKeepBlanksDefault(0). This sets xmlIndentTreeOutput to 1, which seems
to be correct.
But when you call xmlKeepBlanksDefault(1) (which in most cases should be
a no-op) xmlIndentTreeOutput is set to 0 (default is 1). The libxml perl
bindings do this for example, so suddenly indenting is disabled.
So I think the attached patch is the right solution.
Nick
--
aevum gmbh
rumfordstr. 4
80469 münchen
germany
tel: +49 89 3838 0653
http://aevum.de/
--- parserInternals.c.orig 2009-01-24 14:09:53.000000000 +0100
+++ parserInternals.c 2009-01-24 14:10:09.000000000 +0100
@@ -2067,7 +2067,7 @@
int old = xmlKeepBlanksDefaultValue;
xmlKeepBlanksDefaultValue = val;
- xmlIndentTreeOutput = !val;
+ if (!val) xmlIndentTreeOutput = 1;
return(old);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]