From liyilei1979 at gmail.com Sat Apr 16 20:15:37 2011 From: liyilei1979 at gmail.com (Leo Li) Date: Sun, 17 Apr 2011 11:15:37 +0800 Subject: [Usergroups] How to xquery multiple xml files? Message-ID: Hi, I am a new one in xquery and marklogic. I have a question about how to xquery and aggregate informations for multiple xml files. That is, I have several files put in "/my", that is "/my/prods1.xml", "my/prods2.xml" and so on. And I want to write a xquery to sum the prod's amount whose price is greater than 10. It is a little like: let $prods := doc("/my/*")/products/product[price>10] return sum($prods/amount) (Of course the doc("my/*") cannot work.) How can I achieve this? Thanks. -- Good luck! Leo Li -------------- next part -------------- An HTML attachment was scrubbed... URL: http://developer.marklogic.com/pipermail/usergroups/attachments/20110417/5bb22045/attachment.html From Eric.Bloch at marklogic.com Sat Apr 16 23:53:02 2011 From: Eric.Bloch at marklogic.com (Eric Bloch) Date: Sat, 16 Apr 2011 23:53:02 -0700 Subject: [Usergroups] How to xquery multiple xml files? In-Reply-To: References: Message-ID: <3C8F8F1C-7F05-48EB-A0F4-6DCD0C2B4E42@marklogic.com> Please ask this question at general at developer.marklogic.com. Thanks, Eric Eric Bloch Director, Community MarkLogic Corporation desk +1 650 655 2390 | mobile +1 650 339 0376 email eric.bloch at marklogic.com web developer.marklogic.com twitter @eedeebee On Apr 16, 2011, at 8:15 PM, Leo Li wrote: Hi, I am a new one in xquery and marklogic. I have a question about how to xquery and aggregate informations for multiple xml files. That is, I have several files put in "/my", that is "/my/prods1.xml", "my/prods2.xml" and so on. And I want to write a xquery to sum the prod's amount whose price is greater than 10. It is a little like: let $prods := doc("/my/*")/products/product[price>10] return sum($prods/amount) (Of course the doc("my/*") cannot work.) How can I achieve this? Thanks. -- Good luck! Leo Li _______________________________________________ Usergroups mailing list Usergroups at developer.marklogic.com http://developer.marklogic.com/mailman/listinfo/usergroups -------------- next part -------------- An HTML attachment was scrubbed... URL: http://developer.marklogic.com/pipermail/usergroups/attachments/20110416/7e821043/attachment.html