1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
xquery version "1.1";
(:*******************************************************:)
(: Test: switch-005 :)
(: Written by: Michael Kay :)
(: Purpose: switch test, multiple case clauses :)
(:*******************************************************:)
declare variable $animal as xs:string external := "duck";
<out>{
switch (upper-case($animal))
case "COW" return "Moo"
case "CAT" return "Meow"
case "DUCK"
case "GOOSE" return "Quack"
case "PIG"
case "SWINE" return "Oink"
default return "What's that odd noise?"
}</out>
|