We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bbee55b commit 1c79d6aCopy full SHA for 1c79d6a
xml.c
@@ -125,15 +125,9 @@ xml_init(const char *filename)
125
{
126
LIBXML_TEST_VERSION
127
128
- /*
129
- * These two global variables have to be set before xmlReadFile()
130
- * in order for xmlSaveFormatFile() to indent properly.
131
- */
132
- xmlKeepBlanksDefault(0);
133
- xmlIndentTreeOutput = 1;
134
-
+ /* Use XML_PARSE_NOBLANKS for xmlSaveFormatFile() to indent properly */
135
ctx.filename = strdup(filename);
136
- ctx.doc = xmlReadFile(filename, NULL, 0);
+ ctx.doc = xmlReadFile(filename, NULL, XML_PARSE_NOBLANKS);
137
if (!ctx.doc) {
138
fprintf(stderr, "warn: xmlReadFile('%s')\n", filename);
139
}
0 commit comments