Re: str:split, str:tokenize and empty tokens
Sam Liddicott <[email protected]> Tue, 23 Oct 2012 22:34:09 +0100
| Newsgroups | gmane.comp.gnome.lib.xslt |
|---|---|
| Message-ID | <CAOj-5WAPb3VozrTKMPKY9WbgTQbmzAt3vQ_kn6gAQKesqPRGvQ@mail.gmail.com> |
Yes, I found that function useless because of it, so I wrote my own (slow) in xslt which I think I posted here many years ago. I also find it sometimes useful to know what the separator was Sam On Tue, Oct 23, 2012 at 4:00 PM, Nick Wellnhofer <[email protected]>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<http://www.w3.org/1999/XSL/Transform> > " > xmlns:str="http://exslt.org/**strings <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? > > Nick > ______________________________**_________________ > xslt mailing list, project page http://xmlsoft.org/XSLT/ > [email protected] > https://mail.gnome.org/**mailman/listinfo/xslt<https://mail.gnome.org/mailman/listinfo/xslt> > _______________________________________________ xslt mailing list, project page http://xmlsoft.org/XSLT/ [email protected] https://mail.gnome.org/mailman/listinfo/xslt