<assign var="?alltokens" expr="tokenize('in the beginning') />
2. or how to return the second "token" - some kind of subscript on data??
<assign var="?secondtoken" expr="data(tokenize('in the beginning'),2)
/>
"rvj" <r...@rolemodels.net> wrote in message
news:0PSdnRqmfthOjs3Q...@mozilla.org...
<assign var="?secondtoken" expr="subsequence('in','the','beginning'),2)"
/>
"rvj" <r...@rolemodels.net> wrote in message
news:0sqdnW-dv6rAi83Q...@mozilla.org...
<assign var="?secondtoken" expr="subsequence(tokenize(@phrase),2)"
where @phrase is "in the beginning"
"rvj" <r...@rolemodels.net> wrote in message
news:NJqdnQiz6tBNhc3Q...@mozilla.org...
I am not sure what technology you are trying to use. This is the Mozilla
newsgroup for XML. tokenize is a function supported in XPath and XSLT
2.0 and in XQuery 1.0 but as far as I know Mozilla does only support
XSLT and XPath 1.0 which does not know any sequences.
In XPath 2.0 to access the second item in the sequence $foo is simply
$foo[2]
so
tokenize('in the beginning', ' ')[2]
should give you the string 'the'.
--
Martin Honnen
http://msmvps.com/blogs/martin_honnen/