aboutsummaryrefslogtreecommitdiffstats
path: root/xmllint.c
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@src.gnome.org>2001-11-08 17:32:47 +0000
committerDaniel Veillard <veillard@src.gnome.org>2001-11-08 17:32:47 +0000
commitd536f7012d7f114423ca8d42533e478c514899ac (patch)
tree209ccadd15472443b6a721f40f7183d1743ac046 /xmllint.c
parent5004f42ff4579136b5ce4cda2d3bb32a1173db32 (diff)
downloadandroid_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.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/xmllint.c b/xmllint.c
index 9958d0a4..52553563 100644
--- a/xmllint.c
+++ b/xmllint.c
@@ -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