1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-02-05 05:47:00 +03:00

another patch from Aleksey Sanin Daniel

* c14n.c: another patch from Aleksey Sanin
Daniel
This commit is contained in:
Daniel Veillard 2002-03-15 09:42:33 +00:00
parent 5c39654822
commit 6f293b1cde
2 changed files with 13 additions and 3 deletions

View File

@ -1,3 +1,7 @@
Fri Mar 15 10:41:50 CET 2002 Daniel Veillard <daniel@veillard.com>
* c14n.c: another patch from Aleksey Sanin
Fri Mar 15 08:55:55 CET 2002 Daniel Veillard <daniel@veillard.com> Fri Mar 15 08:55:55 CET 2002 Daniel Veillard <daniel@veillard.com>
* c14n.c: applied patch from Aleksey Sanin fixing a problem in the * c14n.c: applied patch from Aleksey Sanin fixing a problem in the

10
c14n.c
View File

@ -787,6 +787,7 @@ xmlC14NProcessElementNode(xmlC14NCtxPtr ctx, xmlNodePtr cur, int visible)
{ {
int ret; int ret;
int ns_rendered_pos = 0; int ns_rendered_pos = 0;
int parent_is_doc = 0;
if ((ctx == NULL) || (cur == NULL) || (cur->type != XML_ELEMENT_NODE)) { if ((ctx == NULL) || (cur == NULL) || (cur->type != XML_ELEMENT_NODE)) {
#ifdef DEBUG_C14N #ifdef DEBUG_C14N
@ -820,6 +821,9 @@ xmlC14NProcessElementNode(xmlC14NCtxPtr ctx, xmlNodePtr cur, int visible)
if (visible) { if (visible) {
if (ctx->parent_is_doc) { if (ctx->parent_is_doc) {
/* save this flag into the stack */
parent_is_doc = ctx->parent_is_doc;
ctx->parent_is_doc = 0;
ctx->pos = XMLC14N_INSIDE_DOCUMENT_ELEMENT; ctx->pos = XMLC14N_INSIDE_DOCUMENT_ELEMENT;
} }
xmlOutputBufferWriteString(ctx->buf, "<"); xmlOutputBufferWriteString(ctx->buf, "<");
@ -874,8 +878,10 @@ xmlC14NProcessElementNode(xmlC14NCtxPtr ctx, xmlNodePtr cur, int visible)
} }
xmlOutputBufferWriteString(ctx->buf, (const char *) cur->name); xmlOutputBufferWriteString(ctx->buf, (const char *) cur->name);
xmlOutputBufferWriteString(ctx->buf, ">"); xmlOutputBufferWriteString(ctx->buf, ">");
if (ctx->parent_is_doc) { if (parent_is_doc) {
ctx->pos = XMLC14N_AFTER_DOCUMENT_ELEMENT; /* restore this flag from the stack for next node */
ctx->parent_is_doc = parent_is_doc;
ctx->pos = XMLC14N_AFTER_DOCUMENT_ELEMENT;
} }
} }