1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-10-26 20:25:14 +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>
* c14n.c: applied patch from Aleksey Sanin fixing a problem in the

12
c14n.c
View File

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