From: Wolfgang M. <wol...@ex...> - 2012-12-21 16:52:57
|
> Thank you all. I'm going to have to think about the answers. But what > I am finding is that where there is no $name-predicate it will not move > on and take up a $place-predicate that is present. I'm only looking for > one or the other, not both. Aha, in this case your approach should work. Would it be possible that local:get-name-predicate() returns something (not '' or ()) even if the parameter is empty? Without local:get-name-predicate, your example does return what I expect: xquery version "3.0"; declare namespace tei="http://www.tei-c.org/ns/1.0"; let $name-predicate := request:get-parameter('people','') let $place-predicate := request:get-parameter('place','#snelston') let $selected-documents := if($name-predicate) then (collection('/db')//tei:persName[@corresp=$name-predicate]) else if($place-predicate) then (collection('/db')//tei:placeName[@corresp=$place-predicate]) else () return $selected-documents Wolfgang |