xsl-list
[Top] [All Lists]

Re: [xsl] Patterns and scoped variables (or rather lack thereof)

2014-02-20 00:22:56
Hi John,

No, you're not being dumb ;). I tried to write this up during the Prague
XML conference, apparently I wasn't focused enough. The second one
should have been count(tokenize($t[1], '\s+')), if mimicked to the
original question's match pattern.

Thanks for pointing it out.

Cheers,
Abel

On 16-2-2014 20:22, John Lumley wrote:
I hope I'm not being dumb, but since tokenize() expects xs:string? as the 
main argument, this predicate should either return false() or trigger an 
error, since if count($t) eq 2, then the second point should complain...

John

On 16 Feb 2014, at 18:01, abel(_at_)exselt(_dot_)net wrote:

<xsl:template match="text()[
   let $t := tokenize(., ':')
   return
      count($t) eq 2 and
      count(tokenize($t, '\s+')) lt 4">
--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>