html - Xslt size of token array (tokenize, number of tokens) -


is there way getting size of token array after having run tokenize($text, '\s+')? without running loop.

i miss java in these cases can run list.size().

cheers

answer

<xsl:variable name="tokens" select="tokenize($text, '\s+')"></xsl:variable> <xsl:value-of select="count($tokens)"></xsl:value-of> 

you should put count() around tokenize. in case count(tokenize($text, '\s+'))


Comments

Popular posts from this blog

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -

python - How to create a legend for 3D bar in matplotlib? -