On 7 May 2011, at 13:18 , Jakob Fix wrote:

> Hi Michael,
> 
> thanks for your reply.  It made my day! From > 4secs to < 0.4 in less
> than two hours! :-)

Glad to hear it.

> boolean($these_agreements/eoi:enforced/text())
> 
> In this case, if all eoi:enforced elements are empty this will return
> false, if there is at least one which contains a date it will return
> true.  I guess, the following expression would be equivalent but
> easier to understand?
> 
> boolean($these_agreements/eoi:enforced[text()])

Good point: I'd forgotten about the effective boolean value behavior, which is 
exactly why I avoid using fn:boolean(). If it's working correctly then I 
suppose there is no reason to change it. But if you do run into unexpected 
behavior you might consider a schema. That would let you write 
data($n/eoi:enforced) instead. Or perhaps something like 
$n/eoi:enforced/xs:boolean(.) might be more predictable.

-- Mike
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to