diff options
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | libxslt/attrvt.c | 12 | ||||
-rw-r--r-- | libxslt/variables.c | 7 | ||||
-rw-r--r-- | tests/docs/Makefile.am | 1 | ||||
-rw-r--r-- | tests/docs/bug-143.xml | 1 | ||||
-rw-r--r-- | tests/general/Makefile.am | 1 | ||||
-rw-r--r-- | tests/general/bug-143.out | 2 | ||||
-rw-r--r-- | tests/general/bug-143.xsl | 10 |
8 files changed, 41 insertions, 1 deletions
@@ -1,3 +1,11 @@ +Thu Feb 26 13:16:33 CET 2004 Daniel Veillard <daniel@veillard.com> + + * 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 <daniel@veillard.com> * libxslt/attributes.c libxslt/keys.h libxslt/preproc.c diff --git a/libxslt/attrvt.c b/libxslt/attrvt.c index 5be2a9b3..54500a1c 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 3938eb4b..75314734 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 cabb0077..8a328668 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 00000000..69d62f2c --- /dev/null +++ b/tests/docs/bug-143.xml @@ -0,0 +1 @@ +<doc/> diff --git a/tests/general/Makefile.am b/tests/general/Makefile.am index 6199da92..534ae094 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 00000000..61380a17 --- /dev/null +++ b/tests/general/bug-143.out @@ -0,0 +1,2 @@ +<?xml version="1.0"?> +<foo bar="0foo1">foo1</foo> diff --git a/tests/general/bug-143.xsl b/tests/general/bug-143.xsl new file mode 100644 index 00000000..a8bf5a95 --- /dev/null +++ b/tests/general/bug-143.xsl @@ -0,0 +1,10 @@ +<xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> +<xsl:variable name="foo">foo</xsl:variable> +<xsl:variable name="bar"> + <foo bar="0{$foo}1">foo1</foo> +</xsl:variable> +<xsl:template match="/"> + <xsl:copy-of select="$bar"/> +</xsl:template> +</xsl:stylesheet> |