- libxslt/templates.c: fixed bug #54451 on escaped curly brackets
authorDaniel Veillard <veillard@src.gnome.org>
Fri, 11 May 2001 15:11:21 +0000 (15:11 +0000)
committerDaniel Veillard <veillard@src.gnome.org>
Fri, 11 May 2001 15:11:21 +0000 (15:11 +0000)
- tests/docs/bug-26-.xml tests/general/bug-26-.*: added test
Daniel

ChangeLog
libxslt/templates.c
tests/docs/bug-26-.xml [new file with mode: 0644]
tests/general/Makefile.am
tests/general/bug-26-.out [new file with mode: 0644]
tests/general/bug-26-.xsl [new file with mode: 0644]

index f07e491..4592ec6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri May 11 17:08:14 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
+
+       * libxslt/templates.c: fixed bug #54451 on escaped curly brackets
+       * tests/docs/bug-26-.xml tests/general/bug-26-.*: added test
+
 Fri May 11 16:20:40 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
 
        * configure.in tests/XSLTMark/Makefile.am: try to handle gracefully
index 9299436..089dad4 100644 (file)
@@ -192,7 +192,10 @@ xsltAttrTemplateValueProcess(xsltTransformContextPtr ctxt, const xmlChar *str) {
            expr = xmlStrndup(str, cur - str);
            if (expr == NULL)
                return(ret);
-           else {
+           else if (*expr == '{') {
+               ret = xmlStrcat(ret, expr);
+               xmlFree(expr);
+           } else {
                xmlXPathCompExprPtr comp;
                /*
                 * TODO: keep precompiled form around
diff --git a/tests/docs/bug-26-.xml b/tests/docs/bug-26-.xml
new file mode 100644 (file)
index 0000000..69d62f2
--- /dev/null
@@ -0,0 +1 @@
+<doc/>
index 32b24fc..824047f 100644 (file)
@@ -29,6 +29,7 @@ EXTRA_DIST = \
     bug-23-.out bug-23-.xsl \
     bug-24-.out bug-24-.xsl \
     bug-25-.out bug-25-.xsl \
+    bug-26-.out bug-26-.xsl \
     character.out character.xsl \
     character2.out character2.xsl \
     itemschoose.out itemschoose.xsl \
diff --git a/tests/general/bug-26-.out b/tests/general/bug-26-.out
new file mode 100644 (file)
index 0000000..04b3fc4
--- /dev/null
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<foo attr="{escaped curly brackets}"/>
diff --git a/tests/general/bug-26-.xsl b/tests/general/bug-26-.xsl
new file mode 100644 (file)
index 0000000..4f7749e
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+               version="1.0">
+
+  <xsl:template match="/">
+    <foo attr="{{escaped curly brackets}}"/>
+  </xsl:template>
+
+</xsl:stylesheet>