let $possible1 as xs:string* := (: go looking for a value via one route :) let $possible2 .... (: all the other routes in preference order :) .... let $foundIt as xs:string := ($possible1,$possible2,$possible3,$possible4,$possible5,'FAILED')[1]
This works nicely in terms of "I got the value by the least-bad route". What I'm blanking on is "how do I tell which was the first possibility to match?" without resorting to sprawl of if-then-else statements. I have the idea that there must be a compact way but I have no idea what it is if there is. Any suggestions? Thanks! Graydon