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

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -