mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-01-26 10:03:34 +03:00
another patch from Aleksey Sanin Daniel
* c14n.c: another patch from Aleksey Sanin Daniel
This commit is contained in:
parent
5c39654822
commit
6f293b1cde
@ -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
12
c14n.c
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user