diff options
author | Daniel Veillard <veillard@src.gnome.org> | 2001-11-08 17:32:47 +0000 |
---|---|---|
committer | Daniel Veillard <veillard@src.gnome.org> | 2001-11-08 17:32:47 +0000 |
commit | d536f7012d7f114423ca8d42533e478c514899ac (patch) | |
tree | 209ccadd15472443b6a721f40f7183d1743ac046 /xmllint.c | |
parent | 5004f42ff4579136b5ce4cda2d3bb32a1173db32 (diff) | |
download | android_external_libxml2-d536f7012d7f114423ca8d42533e478c514899ac.tar.gz android_external_libxml2-d536f7012d7f114423ca8d42533e478c514899ac.tar.bz2 android_external_libxml2-d536f7012d7f114423ca8d42533e478c514899ac.zip |
Morus Walter patch to allow --format and --encode Daniel
* xmllint.c: Morus Walter patch to allow --format and --encode
Daniel
Diffstat (limited to 'xmllint.c')
-rw-r--r-- | xmllint.c | 16 |
1 files changed, 13 insertions, 3 deletions
@@ -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 |