+Thu Jul 24 19:38:56 IST 2003 Daniel Veillard <daniel@veillard.com>
+
+ * libexslt/strings.c: applied patch from Shaun McCance to fix bug
+ #117616 about EXST str:tokenize.
+ * tests/exslt/strings/Makefile.am tests/exslt/strings/tokenize.3.*:
+ added the test in the regression suite.
+
Wed Jul 23 21:57:39 IST 2003 Daniel Veillard <daniel@veillard.com>
* xsltproc/xsltproc.c: applying a patch based on #117377
if (*cur == *delimiter) {
if (cur == token) {
/* discard empty tokens */
+ token = cur + 1;
break;
}
*cur = 0;
}
}
}
- node =
- xmlNewChild((xmlNodePtr) container, NULL,
- (const xmlChar *) "token", token);
- xmlXPathNodeSetAddUnique(ret->nodesetval, node);
+ if (token != cur) {
+ node =
+ xmlNewChild((xmlNodePtr) container, NULL,
+ (const xmlChar *) "token", token);
+ xmlXPathNodeSetAddUnique(ret->nodesetval, node);
+ }
}
}
EXTRA_DIST = \
tokenize.1.xml tokenize.1.xsl tokenize.1.out \
tokenize.2.xml tokenize.2.xsl tokenize.2.out \
+ tokenize.3.xml tokenize.3.xsl tokenize.3.out \
split.1.xml split.1.xsl split.1.out
all:
--- /dev/null
+<?xml version="1.0"?>
+/foo/bar
+ 'foo'
+ 'bar'
+//foo/bar
+ 'foo'
+ 'bar'
+foo//bar
+ 'foo'
+ 'bar'
+foo/bar/
+ 'foo'
+ 'bar'
+foo/bar//
+ 'foo'
+ 'bar'
+
--- /dev/null
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:str="http://exslt.org/strings"
+ version="1.0">
+
+<xsl:template match="/">
+ <xsl:for-each select="//string">
+ <xsl:text><xsl:value-of select="text()"/></xsl:text>
+ <xsl:for-each select="str:tokenize(text(), '/')">
+ <xsl:text> '</xsl:text>
+ <xsl:value-of select="."/>
+ <xsl:text>'</xsl:text>
+ </xsl:for-each>
+ </xsl:for-each>
+</xsl:template>
+
+<xsl:template name="foobar">
+ <string>/foo/bar</string>
+ <string>//foo/bar</string>
+ <string>foo//bar</string>
+ <string>foo/bar/</string>
+ <string>foo/bar//</string>
+</xsl:template>
+
+</xsl:stylesheet>
--- /dev/null
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:str="http://exslt.org/strings"
+ version="1.0">
+
+<xsl:template match="/">
+ <xsl:for-each select="//string">
+ <xsl:value-of select="text()"/>
+ <xsl:text>
+</xsl:text>
+ <xsl:for-each select="str:tokenize(text(), '/')">
+ <xsl:text> '</xsl:text>
+ <xsl:value-of select="."/>
+ <xsl:text>'
+</xsl:text>
+ </xsl:for-each>
+ </xsl:for-each>
+</xsl:template>
+
+<xsl:template name="foobar">
+ <string>/foo/bar</string>
+ <string>//foo/bar</string>
+ <string>foo//bar</string>
+ <string>foo/bar/</string>
+ <string>foo/bar//</string>
+</xsl:template>
+
+</xsl:stylesheet>