Hi Folks,

 

Is there a simple way to program the order by clause in FLWOR to make it
optional based on parameters?  I have a web page that I want to sort as
indicated by the user.

 

For example, this code illustrates what I'd like to do but doesn't work:

 

let $sort-option := "a descending"

return

for $row in $rows 

let $a := $row/a/text()

let $b := $row/b/text()

order by {if ($sort-option eq "a ascending") then $a ascending else
$default}

return <tr><td>{$a}</td><td>{$b}</td></tr>

 

Thanks!

 

Tim Meagher

 

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

Reply via email to