[xquery-talk] more readable format - can let clause help me here

pooja singh p03singh at yahoo.com
Sun Oct 31 08:39:27 PST 2004


Greetings!
 
I am using VB.net and microsoft.xml.xquery.dll. I want to break this long xquery into more readable format. Can someone please suggest me what I am doing wrong.
 
this Query works:(give me the right sum, but very cumbersome to read) 
query =       "let $price:=sum(document(""f1"")//Repair[((RP02/TypeCode='NW' and RP05/Type='0')or (RP02/LaborCode='G' and RP02/ModCode!='LK' and RP02/PartCode!='SL' and RP02/ModCode!='SL' and RP05/Type='0'))]/RP01/DisplayPrice)  " & _

         "return <Amount>{$price}</Amount> "

I tried to break it down like this and obviously this does not work...

query = "let $c1:=""(RP02/TypeCode='NW' and RP05/Type='0')"" " & _

        "let $c2:=""(RP02/LaborCode='G' and RP02/ModCode='LK' and  and RP02/PartCode!='SL' and RP02/ModCode!='SL' and RP05/Type='0' )""  " & _

         "let $price:=sum((document(""f1"")//Repair[$c1 or $c2]/RP01/DisplayPrice))  " & _

         "return <Amount>{$price}</Amount> "

Thanks,
 
-pJ





__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://xquery.com/pipermail/talk/attachments/20041031/01447a52/attachment.htm


More information about the talk mailing list