From: William M. Brack Date: Fri, 16 Jan 2004 14:17:28 +0000 (+0000) Subject: added a newline for any comment before the root element (Bug 130433) fixed X-Git-Tag: v1.1.28~505 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4a88d560dc3f6522c0543142cf337fc5258ed9cb;p=platform%2Fupstream%2Flibxslt.git added a newline for any comment before the root element (Bug 130433) fixed * libxslt/xsltutils.c: added a newline for any comment before the root element (Bug 130433) * libxslt/xslt.c: fixed problem with cdata-section-elements when default namespace is changed (Bug 130793) * tests/extensions/module.out, tests/general/bug-100.out: adjusted for newline after comment change above. * tests/general/Makefile.am, tests/general/bug-140.xsl, tests/general/Makefile.am, tests/docs/bug-140.xml: added test for cdata-section-elements problem. --- diff --git a/ChangeLog b/ChangeLog index 3454311..3d10819 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +Fri Jan 16 22:15:34 HKT 2004 William Brack + + * libxslt/xsltutils.c: added a newline for any comment before + the root element (Bug 130433) + * libxslt/xslt.c: fixed problem with cdata-section-elements when + default namespace is changed (Bug 130793) + * tests/extensions/module.out, tests/general/bug-100.out: adjusted + for newline after comment change above. + * tests/general/Makefile.am, tests/general/bug-140.xsl, + tests/general/Makefile.am, tests/docs/bug-140.xml: added test for + cdata-section-elements problem. + Wed Jan 14 16:44:58 CET 2004 Daniel Veillard * python/libxsl.py: applied shared lib loading patch for OS X from diff --git a/libxslt/xslt.c b/libxslt/xslt.c index b94fe3d..795d10d 100644 --- a/libxslt/xslt.c +++ b/libxslt/xslt.c @@ -775,8 +775,21 @@ xsltParseStylesheetOutput(xsltStylesheetPtr style, xmlNodePtr cur) if (element == NULL) { if (style != NULL) style->errors++; } else { + xmlNsPtr ns; + xmlHashAddEntry2(style->cdataSection, element, URI, (void *) "cdata"); + /* + * if prefix is NULL, we must check whether it's + * necessary to also put in the name of the default + * namespace. + */ + if (URI == NULL) { + ns = xmlSearchNs(style->doc, cur, NULL); + if (ns != NULL) + xmlHashAddEntry2(style->cdataSection, element, + ns->href, (void *) "cdata"); + } xmlFree(element); } } diff --git a/libxslt/xsltutils.c b/libxslt/xsltutils.c index a496c79..bc6f6a3 100644 --- a/libxslt/xsltutils.c +++ b/libxslt/xsltutils.c @@ -1210,7 +1210,8 @@ xsltSaveResultTo(xmlOutputBufferPtr buf, xmlDocPtr result, while (child != NULL) { xmlNodeDumpOutput(buf, result, child, 0, (indent == 1), (const char *) encoding); - if (child->type == XML_DTD_NODE) + if ((child->type == XML_DTD_NODE) || + (child->type == XML_COMMENT_NODE)) xmlOutputBufferWriteString(buf, "\n"); child = child->next; } diff --git a/tests/docs/Makefile.am b/tests/docs/Makefile.am index 2f5511c..2c3f248 100644 --- a/tests/docs/Makefile.am +++ b/tests/docs/Makefile.am @@ -139,6 +139,7 @@ EXTRA_DIST = \ bug-137.xml \ bug-138.xml \ bug-139.xml \ + bug-140.xml \ character.xml \ array.xml \ items.xml diff --git a/tests/docs/bug-140.xml b/tests/docs/bug-140.xml new file mode 100644 index 0000000..54a1d22 --- /dev/null +++ b/tests/docs/bug-140.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/tests/extensions/module.out b/tests/extensions/module.out index eaed1c9..fa2cdd7 100644 --- a/tests/extensions/module.out +++ b/tests/extensions/module.out @@ -1,2 +1,3 @@ -SUCCESS + +SUCCESS diff --git a/tests/general/Makefile.am b/tests/general/Makefile.am index 5581c50..0e2e311 100644 --- a/tests/general/Makefile.am +++ b/tests/general/Makefile.am @@ -145,6 +145,7 @@ EXTRA_DIST = \ bug-137.imp bug-137.out bug-137.xsl \ bug-138.out bug-138.xsl \ bug-139.out bug-139.xsl \ + bug-140.out bug-140.xsl \ character.out character.xsl \ character2.out character2.xsl \ itemschoose.out itemschoose.xsl \ diff --git a/tests/general/bug-100.out b/tests/general/bug-100.out index 478b115..cba12dd 100644 --- a/tests/general/bug-100.out +++ b/tests/general/bug-100.out @@ -1,2 +1,3 @@ + diff --git a/tests/general/bug-140.out b/tests/general/bug-140.out new file mode 100644 index 0000000..93fcad5 --- /dev/null +++ b/tests/general/bug-140.out @@ -0,0 +1,4 @@ + + diff --git a/tests/general/bug-140.xsl b/tests/general/bug-140.xsl new file mode 100644 index 0000000..777ef57 --- /dev/null +++ b/tests/general/bug-140.xsl @@ -0,0 +1,32 @@ + + + + + + + + + + + +]> + + + + + + + + + + + +