From: Daniel Veillard Date: Thu, 7 Oct 2004 14:14:13 +0000 (+0000) Subject: fixed a problem of tree structure raised by the new libxml2 tree checking X-Git-Tag: v1.1.28~368 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4ab7aebf6abb501db8189f517695d4aa64a596bc;p=platform%2Fupstream%2Flibxslt.git fixed a problem of tree structure raised by the new libxml2 tree checking * libxslt/transform.c: fixed a problem of tree structure raised by the new libxml2 tree checking code. Daniel --- diff --git a/ChangeLog b/ChangeLog index 3b7c0db..ffa0205 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Thu Oct 7 16:15:15 CEST 2004 Daniel Veillard + + * libxslt/transform.c: fixed a problem of tree structure raised + by the new libxml2 tree checking code. + Thu Sep 30 11:28:03 PDT 2004 William Brack * libexslt/date.c: fixed problem with negative periods diff --git a/libxslt/transform.c b/libxslt/transform.c index 4515bb8..90f1df5 100644 --- a/libxslt/transform.c +++ b/libxslt/transform.c @@ -4174,14 +4174,24 @@ xsltApplyStylesheetInternal(xsltStylesheetPtr style, xmlDocPtr doc, XSLT_GET_IMPORT_PTR(doctypePublic, style, doctypePublic) XSLT_GET_IMPORT_PTR(doctypeSystem, style, doctypeSystem) if (((doctypePublic != NULL) || (doctypeSystem != NULL))) { + xmlNodePtr last; /* Need a small "hack" here to assure DTD comes before possible comment nodes */ node = res->children; + last = res->last; res->children = NULL; + res->last = NULL; res->intSubset = xmlCreateIntSubset(res, doctype, doctypePublic, doctypeSystem); - res->children->next = node; + if (res->children != NULL) { + res->children->next = node; + node->prev = res->children; + res->last = last; + } else { + res->children = node; + res->last = last; + } } } }