|
[XQuery Talk Mailing List Archive Home] [By Date] [By Thread] [By Subject] [By Author] [Recent Entries] [Reply To This Message] XQuery count()G. Ken Holman gkholman at CraneSoftwrights.comMon Nov 9 14:07:10 PST 2009
At 2009-11-09 18:55 +0000, Ricardo Queirós wrote: >I need to count the total number of distinct >collections in my db (eXist XML Database). How are you defining "distinct" in your situation? There are many possible ways: string value, tree structure, tree structure of string values, etc. >How can i do this in a compact way using XQuery? Consider using deep-equal() ... if you have two root nodes, say in $a and $b, you can get true/false with deep-equal( $a, $b ) and it will check the tree structure and the node values in the tree structure and things like attributes will be checked regardless of their order (because attributes in XML documents are unordered). But be aware this is an "expensive" function, and could take up a lot of processing resources to accomplish the comparison. I hope this helps. . . . . . . . . . . . Ken -- Upcoming: hands-on XSLT, XQuery and XSL-FO Washington DC Nov 2009 Interested in other classes? http://www.CraneSoftwrights.com/q/i/ Crane Softwrights Ltd. http://www.CraneSoftwrights.com/q/ Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video Video lesson: http://www.youtube.com/watch?v=PrNjJCh7Ppg&fmt=18 Video overview: http://www.youtube.com/watch?v=VTiodiij6gE&fmt=18 G. Ken Holman mailto:http://x-query.com/mailman/listinfo/talk Male Cancer Awareness Nov'07 http://www.CraneSoftwrights.com/q/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal
|
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
|






