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 56f992f commit ee53abfCopy full SHA for ee53abf
xml.c
@@ -129,6 +129,14 @@ void
129
xml_init(const char *filename)
130
{
131
LIBXML_TEST_VERSION
132
+
133
+ /*
134
+ * These two global variables have to be set before xmlReadFile()
135
+ * in order for xmlSaveFormatFile() to indent properly.
136
+ */
137
+ xmlKeepBlanksDefault(0);
138
+ xmlIndentTreeOutput = 1;
139
140
ctx.filename = strdup(filename);
141
ctx.doc = xmlReadFile(filename, NULL, 0);
142
if (!ctx.doc) {
@@ -139,7 +147,7 @@ xml_init(const char *filename)
147
void
148
xml_save(void)
149
- xmlSaveFile(ctx.filename, ctx.doc);
150
+ xmlSaveFormatFile(ctx.filename, ctx.doc, 1);
143
151
}
144
152
145
153
0 commit comments