diff options
author | Daniel Veillard <veillard@src.gnome.org> | 2003-07-24 18:41:50 +0000 |
---|---|---|
committer | Daniel Veillard <veillard@src.gnome.org> | 2003-07-24 18:41:50 +0000 |
commit | 91cefd843f536e0ce003fa0bc9ee1de036a8c8dc (patch) | |
tree | 2fcffedcf306f4216f1400355fa3fda0e0bf00d9 /tests/exslt | |
parent | 1895007219c2650c452aeed878ccb5bf66ae8df1 (diff) | |
download | libxslt-91cefd843f536e0ce003fa0bc9ee1de036a8c8dc.tar.gz libxslt-91cefd843f536e0ce003fa0bc9ee1de036a8c8dc.tar.bz2 libxslt-91cefd843f536e0ce003fa0bc9ee1de036a8c8dc.zip |
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
Diffstat (limited to 'tests/exslt')
-rw-r--r-- | tests/exslt/strings/Makefile.am | 1 | ||||
-rw-r--r-- | tests/exslt/strings/tokenize.3.out | 17 | ||||
-rw-r--r-- | tests/exslt/strings/tokenize.3.xml | 25 | ||||
-rw-r--r-- | tests/exslt/strings/tokenize.3.xsl | 28 |
4 files changed, 71 insertions, 0 deletions
diff --git a/tests/exslt/strings/Makefile.am b/tests/exslt/strings/Makefile.am index 5ccb5a8e..76125223 100644 --- a/tests/exslt/strings/Makefile.am +++ b/tests/exslt/strings/Makefile.am @@ -6,6 +6,7 @@ $(top_builddir)/xsltproc/xsltproc: 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: diff --git a/tests/exslt/strings/tokenize.3.out b/tests/exslt/strings/tokenize.3.out new file mode 100644 index 00000000..539a2fb6 --- /dev/null +++ b/tests/exslt/strings/tokenize.3.out @@ -0,0 +1,17 @@ +<?xml version="1.0"?> +/foo/bar + 'foo' + 'bar' +//foo/bar + 'foo' + 'bar' +foo//bar + 'foo' + 'bar' +foo/bar/ + 'foo' + 'bar' +foo/bar// + 'foo' + 'bar' + diff --git a/tests/exslt/strings/tokenize.3.xml b/tests/exslt/strings/tokenize.3.xml new file mode 100644 index 00000000..9d5c2937 --- /dev/null +++ b/tests/exslt/strings/tokenize.3.xml @@ -0,0 +1,25 @@ +<?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> diff --git a/tests/exslt/strings/tokenize.3.xsl b/tests/exslt/strings/tokenize.3.xsl new file mode 100644 index 00000000..2ea6b12e --- /dev/null +++ b/tests/exslt/strings/tokenize.3.xsl @@ -0,0 +1,28 @@ +<?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> |