From 336a98a01af12ef8509f6eb8fbe05cdd1cca7171 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Petr=20P=C3=ADsa=C5=99?= Date: Sun, 3 Jan 2010 13:53:44 +0100 Subject: [PATCH] dump_nodeset() does not short empty elements Can not unescape attributes still. --- src/isds.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/isds.c b/src/isds.c index 134e9e1..84cff3d 100644 --- a/src/isds.c +++ b/src/isds.c @@ -1028,14 +1028,27 @@ static isds_error dump_nodeset(struct isds_ctx *context, err = IE_ERROR; goto leave; } - /* Last argument 0 means to not format the XML tree */ + if (xmlSubstituteEntitiesDefault(1)) { + isds_log_message(context, _("Could not disable attribute escaping")); + err = IE_ERROR; + goto leave; + } + /* Last argument means: + * 0 to not format the XML tree + * XML_SAVE_NO_EMPTY ISDS does not produce shorten tags */ save_ctx = xmlSaveToBuffer(xml_buffer, "UTF-8", - XML_SAVE_NO_DECL|XML_SAVE_NO_XHTML); + XML_SAVE_NO_DECL|XML_SAVE_NO_EMPTY|XML_SAVE_NO_XHTML); if (!save_ctx) { isds_log_message(context, _("Could not create XML serializer")); err = IE_ERROR; goto leave; } + /*if (xmlSaveSetAttrEscape(save_ctx, NULL)) { + isds_log_message(context, _("Could not disable attribute escaping")); + err = IE_ERROR; + goto leave; + }*/ + /* Itearate over all nodes */ for (int i = 0; i < nodeset->nodeNr; i++) { -- 2.11.4.GIT