diff options
author | Daniel Veillard <veillard@src.gnome.org> | 2000-12-27 10:46:47 +0000 |
---|---|---|
committer | Daniel Veillard <veillard@src.gnome.org> | 2000-12-27 10:46:47 +0000 |
commit | a6d8eb6256e4b4165976318a0f058b7c51330564 (patch) | |
tree | 8682efe726f8c100d017325ed1d9ceef726bf061 /xmllint.c | |
parent | a1fe9104b60f329d94a56122de312255a1edc7ef (diff) | |
download | android_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.c | 20 |
1 files changed, 18 insertions, 2 deletions
@@ -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 } |