[xslt] str:tokenize won't split strings into chars?



Hello,

Am I overlooking something or is the str:tokenize extension not working
properly? The description on this page:

  http://www.exslt.org/str/functions/tokenize/index.html

suggests that if the second argument to str:tokenize is an empty string, it will
return a node-set of token elements containing one character each.

But when I run this XSL:


<?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; xmlns:str="http://exslt.org/strings"; extension-element-prefixes="str" version="1.0"


<xsl:template match="/*"> <a> <xsl:copy-of select="str:tokenize('abc', '')" /> </a> </xsl:template>

</xsl:stylesheet>


on any XML, I get this output:


<?xml version="1.0" encoding="UTF-8"?> <a><token>abc</token></a>


instead of this:


<?xml version="1.0" encoding="UTF-8"?> <a><token>a</token><token>b</token><token>c</token></a>


I couldn't find any mention of this on the list archive or in Bugzilla, my apologies if it's already been addressed. My xsltproc:


[pawlowski libxslt]$ ./xsltproc --version
Using libxml 20611, libxslt 10108 and libexslt 806
xsltproc was compiled against libxml 20611, libxslt 10108 and libexslt 806
libxslt 10108 was compiled against libxml 20611
libexslt 806 was compiled against libxml 20611


Thanks, I really appreciate your help!

Peter


--

Peter Pawlowski
pawlowski vivisimo com  412 422 2499 x116
Software Engineer, Lead Linguist
Vivisimo, Inc

"Organized information
from anywhere, any time,
in any language."





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]