aboutsummaryrefslogtreecommitdiffstats
path: root/xmllint.c
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@src.gnome.org>2000-12-27 10:46:47 +0000
committerDaniel Veillard <veillard@src.gnome.org>2000-12-27 10:46:47 +0000
commita6d8eb6256e4b4165976318a0f058b7c51330564 (patch)
tree8682efe726f8c100d017325ed1d9ceef726bf061 /xmllint.c
parenta1fe9104b60f329d94a56122de312255a1edc7ef (diff)
downloadandroid_external_libxml2-a6d8eb6256e4b4165976318a0f058b7c51330564.tar.gz
android_external_libxml2-a6d8eb6256e4b4165976318a0f058b7c51330564.tar.bz2
android_external_libxml2-a6d8eb6256e4b4165976318a0f058b7c51330564.zip
Finally had a bit of time to resynch both trees:
- HTMLparser.[ch]: added a way to avoid adding automatically omitted tags. htmlHandleOmittedElem() allows to change the default handling. - tree.[ch] xmllint.c: added xmlDocDumpFormatMemory() and xmlDocDumpFormatMemoryEnc(), uses memory functions for output of xmllint too when using --memory flag, added a memory test suite at the Makefile level. - xpathInternals.h xpath.[ch] xpointer.c: fixed problems with namespace use when encountering QNames in XPath evalation, added xmlns() scheme in XPointer. - nanoftp.c : incorporated a fix - parser.c xmlIO.c: fixed problems raised with encoding when using the memory I/O - parserInternals.c: closed bug 25934 reported by torsten.landschoff@innominate.de - TODO: updated Daniel
Diffstat (limited to 'xmllint.c')
-rw-r--r--xmllint.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/xmllint.c b/xmllint.c
index 099084b8..3dd413a6 100644
--- a/xmllint.c
+++ b/xmllint.c
@@ -565,15 +565,31 @@ void parseAndPrintFile(char *filename) {
#ifdef LIBXML_DEBUG_ENABLED
if (!debug) {
#endif
- if (compress)
+ if (memory) {
+ xmlChar *result;
+ int len;
+
+ if (encoding != NULL) {
+ xmlDocDumpMemoryEnc(doc, &result, &len, encoding);
+ } else {
+ xmlDocDumpMemory(doc, &result, &len);
+ }
+ if (result == NULL) {
+ fprintf(stderr, "Failed to save\n");
+ } else {
+ write(1, result, len);
+ xmlFree(result);
+ }
+ } else if (compress)
xmlSaveFile("-", doc);
else if (encoding != NULL)
xmlSaveFileEnc("-", doc, encoding);
else
xmlDocDump(stdout, doc);
#ifdef LIBXML_DEBUG_ENABLED
- } else
+ } else {
xmlDebugDumpDocument(stdout, doc);
+ }
#endif
}