Commit d536f701 authored by Daniel Veillard's avatar Daniel Veillard
Browse files

Morus Walter patch to allow --format and --encode Daniel

* xmllint.c: Morus Walter patch to allow --format and --encode
Daniel
parent 5004f42f
Thu Nov 8 18:31:40 CET 2001 Daniel Veillard <daniel@veillard.com>
* xmllint.c: Morus Walter patch to allow --format and --encode
Thu Nov 8 14:52:18 CET 2001 Daniel Veillard <daniel@veillard.com>
* debugXML.c: Stefan Kost provided an help command for the shell
......
......@@ -672,7 +672,11 @@ static void parseAndPrintFile(char *filename) {
int len;
if (encoding != NULL) {
xmlDocDumpMemoryEnc(doc, &result, &len, encoding);
if ( format ) {
xmlDocDumpFormatMemoryEnc(doc, &result, &len, encoding, 1);
} else {
xmlDocDumpMemoryEnc(doc, &result, &len, encoding);
}
} else {
if (format)
xmlDocDumpFormatMemory(doc, &result, &len, 1);
......@@ -689,8 +693,14 @@ static void parseAndPrintFile(char *filename) {
#endif /* HAVE_SYS_MMAN_H */
if (compress)
xmlSaveFile("-", doc);
else if (encoding != NULL)
xmlSaveFileEnc("-", doc, encoding);
else if (encoding != NULL) {
if ( format ) {
xmlSaveFormatFileEnc("-", doc, encoding, 1);
}
else {
xmlSaveFileEnc("-", doc, encoding);
}
}
else if (format)
xmlSaveFormatFile("-", doc, 1);
else
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment