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
diff --git a/xmllint.c b/xmllint.c
index 099084b..3dd413a 100644
--- a/xmllint.c
+++ b/xmllint.c
@@ -565,15 +565,31 @@
#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
}