Re: [xslt] str:split, str:tokenize and empty tokens



On Tue, Oct 23, 2012 at 05:00:31PM +0200, Nick Wellnhofer wrote:
> I just found out that str:split and str:tokenize extension functions
> ignore empty tokens. For example, take the following stylesheet:
> 
> <xsl:stylesheet
>     version="1.0"
>     xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
>     xmlns:str="http://exslt.org/strings";
>     extension-element-prefixes="str">
> <xsl:output indent="yes"/>
> <xsl:template match="/">
>     <result>
>         <xsl:copy-of select="str:split('a|b||c', '|')"/>
>     </result>
> </xsl:template>
> </xsl:stylesheet>
> 
> And it will produce:
> 
> <result>
>   <token>a</token>
>   <token>b</token>
>   <token>c</token>
> </result>
> 
> This seems wrong to me, and I couldn't find anything in the EXSLT
> spec that mandates this behavior. Thoughts?

  Do other implementations do the same, if yes too bad, work around
it, if no and EXSLT doesn't mandate that behaviour, feel free to fix :-)

Daniel

-- 
Daniel Veillard      | Open Source and Standards, Red Hat
veillard redhat com  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | virtualization library  http://libvirt.org/


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