Mukul,
Yes, you are right.  Count() works as you say.

Thank you for your help.


-          Jim

From: Mukul Gandhi [mailto:muk...@apache.org]
Sent: Friday, April 19, 2013 12:30 AM
To: j-users@xerces.apache.org
Subject: Re: problems using tokenize()

Hi Jim,
 With a boolean() function around 'tokenize' call, an "effective boolean value" 
of xs:string* result of 'tokenize' will be returned. But this would result in 
an error as per XPath 2.0 spec, for your example. I imagine, an 'exists' or 
'count' function around tokenize() would let you achieve the same purpose as 
matches().


Sent from a mobile device.

On Thursday, April 18, 2013, Jim Barnett 
<jim.barn...@genesyslab.com<mailto:jim.barn...@genesyslab.com>> wrote:
> I'm having trouble getting tokenize() to behave the way I expect it to.  As 
> before, I have an element with an attribute @target with type idrefs.  I want 
> to split the value into the individual idrefs (I will run more complicated 
> tests on them, but for the moment I'm just trying to get access to them).  In 
> the attached document and schema, I have two assertions.  The first, using 
> matches() succeeds, but the second, using tokenize(), fails:
>
>
>
> <xsd:assert test="matches(string(@target), '\S+(\s+\S+)+')" 
> xpathDefaultNamespace="##targetNamespace"/>
>
> <xsd:assert test="boolean(tokenize(string(@target), '\s+'))"  
> xpathDefaultNamespace="##targetNamespace"/>
>
>
>
> What am I doing wrong?
>
>
>
> Thanks,
>
> Jim

--
Regards,
Mukul Gandhi

Reply via email to