[MarkLogic Dev General] question about calculating data from cts:element-values

helen chen hchen at aip.org
Thu Aug 26 06:13:40 PDT 2010


Hi there,

I need to do a thing: 

In each article, there is a unique element called volume, it is a number value.  I need to return a range list that divide the volume number into 100 and then make the list like:
1000-1099, 1100-1199, 1200-1299....

This is to group the volume list into shorter list for user because we have a huge list of volume number, you can say 8000 for now, and it grows very fast.

What I did is: I use cts:element-values to return the unique volume list, then  I go through this list and build the range.  I feel that this is not fast as what I want because this is only small part of the page.

 I'm thinking to add an element volume-range to each article for this rage so I can do cts:element-values for this new element, but I have a requirement that: when it is the lowest volume, I have to show like 1008-1099, and when it is the max volume number, I have to show like 8800-8823.  The article with new volume number can come in at any time, so I still need to get the unique volume list to figure out the max volume number and min volume number using cts:element-values, and then I use cts:element-values for volume-range to get range list, and then do the min/max replace. It does not seem to me as a good solution.

Does anyone have any suggestions for this?

Thanks, Helen


More information about the General mailing list