|
[XQuery Talk Mailing List Archive Home] [By Date] [By Thread] [By Subject] [By Author] [Recent Entries] [Reply To This Message] Help With Typeswitch Expression?Wei, Alice J. ajwei at indiana.eduThu Mar 27 10:17:08 PST 2008
Hi, XQueriers: I am not sure if I should be using a typeswitch expression here. My XQuery snippet: if (($type ne "") and ($type2 eq "greeting") and ($type3 eq "") and ($type4 eq "")) then <div><p>This is what you typed: {$type2} : {$type}</p[></div> else <p>You have not typed anything!</p> This is what I tried: typeswitch($type) case $h as xs:anyAtomicType) return <div><p>This is what you typed: {$type2} : {$type}</p[></div> The problem in this code is that I could not get it to say that I want $type2 to match "greeting." I have also tried using a let clause declare that $type, $type2, $type3 and $type4 are actually external variables from the http request, which this failed since it appears that typeswitch does not allow me to put anything before its function. Have I misunderstood what typeswitch is meant to do? And, to solve the issue from encoding too many of these if else statements, what are the other options? Thanks for your help. Alice ====================================================== Alice Wei MIS 2008 School of Library and Information Science Indiana University Bloomington http://x-query.com/mailman/listinfo/talk
|
Purchase Stylus Studio Online Today!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|






