From: Daniel Veillard Date: Thu, 26 Feb 2004 12:19:15 +0000 (+0000) Subject: fixed a regression for AVT found in global variable content. added test to X-Git-Tag: v1.1.28~481 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=35184c89089ecdbdc202cd24ba30db9b082601aa;p=platform%2Fupstream%2Flibxslt.git fixed a regression for AVT found in global variable content. added test to * libxslt/attrvt.c libxslt/variables.c: fixed a regression for AVT found in global variable content. * tests/docs/Makefile.am tests/docs/bug-143.xml tests/general/Makefile.am tests/docs/bug-143*: added test to the regression suite. Daniel --- diff --git a/ChangeLog b/ChangeLog index adcd5be..ca2f29a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Thu Feb 26 13:16:33 CET 2004 Daniel Veillard + + * libxslt/attrvt.c libxslt/variables.c: fixed a regression for + AVT found in global variable content. + * tests/docs/Makefile.am tests/docs/bug-143.xml + tests/general/Makefile.am tests/docs/bug-143*: added test + to the regression suite. + Wed Feb 25 16:35:01 CET 2004 Daniel Veillard * libxslt/attributes.c libxslt/keys.h libxslt/preproc.c diff --git a/libxslt/attrvt.c b/libxslt/attrvt.c index 5be2a9b..54500a1 100644 --- a/libxslt/attrvt.c +++ b/libxslt/attrvt.c @@ -29,7 +29,6 @@ #ifdef WITH_XSLT_DEBUG #define WITH_XSLT_DEBUG_AVT -#define WITH_XSLT_DEBUG_AVT #endif #define MAX_AVT_SEG 10 @@ -158,6 +157,17 @@ xsltCompileAttr(xsltStylesheetPtr style, xmlAttrPtr attr) { if ((xmlStrchr(str, '{') == NULL) && (xmlStrchr(str, '}') == NULL)) return; +#ifdef WITH_XSLT_DEBUG_AVT + xsltGenericDebug(xsltGenericDebugContext, + "Found AVT %s: %s\n", attr->name, str); +#endif + if (attr->_private != NULL) { +#ifdef WITH_XSLT_DEBUG_AVT + xsltGenericDebug(xsltGenericDebugContext, + "AVT %s: already compiled\n"); +#endif + return; + } avt = xsltNewAttrVT(style); if (avt == NULL) return; attr->_private = avt; diff --git a/libxslt/variables.c b/libxslt/variables.c index 3938eb4..7531473 100644 --- a/libxslt/variables.c +++ b/libxslt/variables.c @@ -1405,6 +1405,9 @@ xsltParseGlobalVariable(xsltStylesheetPtr style, xmlNodePtr cur) { return; } + if (cur->children != NULL) { + xsltParseTemplateContent(style, cur); + } #ifdef WITH_XSLT_DEBUG_VARIABLE xsltGenericDebug(xsltGenericDebugContext, "Registering global variable %s\n", comp->name); @@ -1444,6 +1447,10 @@ xsltParseGlobalParam(xsltStylesheetPtr style, xmlNodePtr cur) { return; } + if (cur->children != NULL) { + xsltParseTemplateContent(style, cur); + } + #ifdef WITH_XSLT_DEBUG_VARIABLE xsltGenericDebug(xsltGenericDebugContext, "Registering global param %s\n", comp->name); diff --git a/tests/docs/Makefile.am b/tests/docs/Makefile.am index cabb007..8a32866 100644 --- a/tests/docs/Makefile.am +++ b/tests/docs/Makefile.am @@ -142,6 +142,7 @@ EXTRA_DIST = \ bug-140.xml \ bug-141.xml \ bug-142.xml \ + bug-143.xml \ character.xml \ array.xml \ items.xml diff --git a/tests/docs/bug-143.xml b/tests/docs/bug-143.xml new file mode 100644 index 0000000..69d62f2 --- /dev/null +++ b/tests/docs/bug-143.xml @@ -0,0 +1 @@ + diff --git a/tests/general/Makefile.am b/tests/general/Makefile.am index 6199da9..534ae09 100644 --- a/tests/general/Makefile.am +++ b/tests/general/Makefile.am @@ -148,6 +148,7 @@ EXTRA_DIST = \ bug-140.out bug-140.xsl \ bug-141.out bug-141.xsl \ bug-142.out bug-142.xsl \ + bug-143.out bug-143.xsl \ character.out character.xsl \ character2.out character2.xsl \ itemschoose.out itemschoose.xsl \ diff --git a/tests/general/bug-143.out b/tests/general/bug-143.out new file mode 100644 index 0000000..61380a1 --- /dev/null +++ b/tests/general/bug-143.out @@ -0,0 +1,2 @@ + +foo1 diff --git a/tests/general/bug-143.xsl b/tests/general/bug-143.xsl new file mode 100644 index 0000000..a8bf5a9 --- /dev/null +++ b/tests/general/bug-143.xsl @@ -0,0 +1,10 @@ + +foo + + foo1 + + + + +