Skip to content
Snippets Groups Projects
Commit 7c5c765be225 authored by Daniel Veillard's avatar Daniel Veillard
Browse files

applied patch from Shaun McCance to fix bug #117616 about EXST

* 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.
Daniel
parent 04098a7082a9
Branches
No related tags found
No related merge requests found
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
......
......@@ -79,6 +79,7 @@
if (*cur == *delimiter) {
if (cur == token) {
/* discard empty tokens */
token = cur + 1;
break;
}
*cur = 0;
......@@ -92,9 +93,10 @@
}
}
}
if (token != cur) {
node =
xmlNewChild((xmlNodePtr) container, NULL,
(const xmlChar *) "token", token);
xmlXPathNodeSetAddUnique(ret->nodesetval, node);
}
}
......@@ -95,9 +97,10 @@
node =
xmlNewChild((xmlNodePtr) container, NULL,
(const xmlChar *) "token", token);
xmlXPathNodeSetAddUnique(ret->nodesetval, node);
}
}
}
fail:
if (str != NULL)
......
......@@ -6,6 +6,7 @@
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:
......
<?xml version="1.0"?>
/foo/bar
'foo'
'bar'
//foo/bar
'foo'
'bar'
foo//bar
'foo'
'bar'
foo/bar/
'foo'
'bar'
foo/bar//
'foo'
'bar'
<?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>
<?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>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment