From: William M. Brack Date: Mon, 12 Jan 2004 16:36:42 +0000 (+0000) Subject: changed to assure comment which preceeds root node is output after DTD X-Git-Tag: v1.1.28~509 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=32848e981e953cebb228ced594f7302ea4d85fa7;p=platform%2Fupstream%2Flibxslt.git changed to assure comment which preceeds root node is output after DTD * libxslt/transform.c: changed to assure comment which preceeds root node is output after DTD (Bug 130433) * test/exslt/common/node-set.4.*: added test case for Bug 130922 --- diff --git a/ChangeLog b/ChangeLog index 7e561de..9dd53d9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Tue Jan 13 00:33:50 HKT 2004 William Brack + + * libxslt/transform.c: changed to assure comment which + preceeds root node is output after DTD (Bug 130433) + * test/exslt/common/node-set.4.*: added test case for + Bug 130922 + Mon Jan 12 12:51:45 HKT 2004 William Brack * doc/site.xsl: Changed logo spacing to avoid stacking diff --git a/libxslt/transform.c b/libxslt/transform.c index fe39651..c134337 100644 --- a/libxslt/transform.c +++ b/libxslt/transform.c @@ -3855,7 +3855,7 @@ xsltApplyStylesheetInternal(xsltStylesheetPtr style, xmlDocPtr doc, { xmlDocPtr res = NULL; xsltTransformContextPtr ctxt = NULL; - xmlNodePtr root; + xmlNodePtr root, node; const xmlChar *method; const xmlChar *doctypePublic; const xmlChar *doctypeSystem; @@ -4068,11 +4068,17 @@ xsltApplyStylesheetInternal(xsltStylesheetPtr style, xmlDocPtr doc, } if (ctxt->type == XSLT_OUTPUT_XML) { XSLT_GET_IMPORT_PTR(doctypePublic, style, doctypePublic) - XSLT_GET_IMPORT_PTR(doctypeSystem, style, doctypeSystem) - if (((doctypePublic != NULL) || (doctypeSystem != NULL))) + XSLT_GET_IMPORT_PTR(doctypeSystem, style, doctypeSystem) + if (((doctypePublic != NULL) || (doctypeSystem != NULL))) { + /* Need a small "hack" here to assure DTD comes before + possible comment nodes */ + node = res->children; + res->children = NULL; res->intSubset = xmlCreateIntSubset(res, root->name, doctypePublic, doctypeSystem); + res->children->next = node; + } } } xmlXPathFreeNodeSet(ctxt->nodeList); diff --git a/tests/exslt/common/Makefile.am b/tests/exslt/common/Makefile.am index 42287ee..759f27a 100644 --- a/tests/exslt/common/Makefile.am +++ b/tests/exslt/common/Makefile.am @@ -7,6 +7,7 @@ EXTRA_DIST = \ node-set.1.xml node-set.1.xsl node-set.1.out \ node-set.2.xml node-set.2.xsl node-set.2.out \ node-set.3.xml node-set.3.xsl node-set.3.out \ + node-set.4.xml node-set.4.xsl node-set.4.out \ object-type.1.xml object-type.1.xsl object-type.1.out \ import-test1a.imp import-test1b.imp import-test1.out \ import-test1.xml import-test1.xsl diff --git a/tests/exslt/common/node-set.4.out b/tests/exslt/common/node-set.4.out new file mode 100644 index 0000000..4295f03 --- /dev/null +++ b/tests/exslt/common/node-set.4.out @@ -0,0 +1,2 @@ + +Mode of FOO is inputMode of FOO is fiddled diff --git a/tests/exslt/common/node-set.4.xml b/tests/exslt/common/node-set.4.xml new file mode 100644 index 0000000..1464b0d --- /dev/null +++ b/tests/exslt/common/node-set.4.xml @@ -0,0 +1,37 @@ + + + + + + + + Mode of FOO is + + + + + + + + + + + + + + fiddled + + + + + + Mode of FOO is + + + + + + + diff --git a/tests/exslt/common/node-set.4.xsl b/tests/exslt/common/node-set.4.xsl new file mode 100644 index 0000000..50c976c --- /dev/null +++ b/tests/exslt/common/node-set.4.xsl @@ -0,0 +1,37 @@ + + + + + + + + Mode of FOO is + + + + + + + + + + + + + + fiddled + + + + + + Mode of FOO is + + + + + + +