+Sun Aug 3 19:46:42 HTK 2003 William Brack <wbrack@mmm.com.hk>
+
+ Fixed bug 116517 - handling of '{' and '}'
+ * templates.c: added checks for escaping and balancing of
+ curly brackets
+ * tests/general/Makefile.am tests/docs/Makefile.am:
+ Added test case (bug-126) to regression suite.
+
Sun Aug 3 15:50:51 HKT 2003 William Brack <wbrack@mmm.com.hk>
Fixed bug 117552 - sort with multiple keys
cur = str;
while (*cur != 0) {
if (*cur == '{') {
+ if (*(cur+1) == '{') { /* escaped '{' */
+ cur++;
+ ret = xmlStrncat(ret, str, cur - str);
+ cur++;
+ str = cur;
+ continue;
+ }
ret = xmlStrncat(ret, str, cur - str);
str = cur;
cur++;
while ((*cur != 0) && (*cur != '}')) cur++;
if (*cur == 0) {
+ xsltTransformError(ctxt, NULL, NULL,
+ "xsltAttrTemplateValueProcessNode: unmatched '{'\n");
ret = xmlStrncat(ret, str, cur - str);
return(ret);
}
}
cur++;
str = cur;
+ } else if (*cur == '}') {
+ cur++;
+ if (*cur == '}') { /* escaped '}' */
+ ret = xmlStrncat(ret, str, cur - str);
+ cur++;
+ str = cur;
+ continue;
+ } else {
+ xsltTransformError(ctxt, NULL, NULL,
+ "xsltAttrTemplateValueProcessNode: unmatched '}'\n");
+ }
} else
cur++;
}
bug-123.xml \
bug-124.xml \
bug-125.xml \
+ bug-126.xml \
character.xml \
array.xml \
items.xml
bug-123.out bug-123.xsl \
bug-124.out bug-124.xsl \
bug-125.out bug-125.xsl \
+ bug-126.out bug-126.xsl \
character.out character.xsl \
character2.out character2.xsl \
itemschoose.out itemschoose.xsl \
--- /dev/null
+<?xml version="1.0"?>
+
+ <foo attr="$x"/> Expect '$x'
+ <foo attr="val"/> Expect 'val'
+ <foo attr="{$x"/> Expect 'bracket $x'
+ <foo attr="$x}"/> Expect '$x bracket'
+ <foo attr="{$x}"/> Expect 'bracket $x bracket'
+ <foo attr="{val}"/> Expect 'bracket val bracket'
+
--- /dev/null
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ version="1.0">
+
+<xsl:variable name="x" select="'val'" />
+ <xsl:template match="/">
+ <xsl:text>
+ </xsl:text>
+ <foo attr="$x"/> Expect '$x'
+ <foo attr="{$x}"/> Expect 'val'
+ <foo attr="{{$x"/> Expect 'bracket $x'
+ <foo attr="$x}}"/> Expect '$x bracket'
+ <foo attr="{{$x}}"/> Expect 'bracket $x bracket'
+ <foo attr="{{{$x}}}"/> Expect 'bracket val bracket'
+ </xsl:template>
+
+</xsl:stylesheet>