Interstage Shunsaku Data Manager Application Development Guide - Microsoft(R) Windows(R) 2000/ Microsoft(R) Windows Server(TM) 2003 - - UNIX -
Contents Index PreviousNext

Part 1 The Basic for Developing Application> Chapter 3 Data Search Methods> 3.7 Extracting Aggregated Results> 3.7.1 Grouping Search Results

3.7.1.2 Grouping by Numeric Value

Search results are grouped by treating the value of an element node in an XML document or the value of that attribute nodes of that element node as a numeric value.

To group by numeric values, specify the single-line val function in the key specification of the sort expression. Specify a text expression or attribute expression as the argument of the val function.

Refer to B.2.4 Single-line Function Specification for more information on the val function.

The following explanation assumes that Documents A, B, C, and D, below exist:

Document A

<doc>
  <employee>
    :
    <department sno="2001">Development Dep.</department>
    :
  </employee>
    :
</doc>

Document B

<doc>
  <employee>
    :
    <department sno="2002">Human Resource Dep.</department>
    :
  </employee>
    :
</doc>

Document C

<doc>
  <employee>
    :
    <department sno="2001">Development Dep.</department>
    :
  </employee>
    :
</doc>

Document D

<doc>
  <employee>
    :
    <department sno="2002">Human Resource Dep.</department>
    :
  </employee>
    :
</doc>

Example

The following example shows how to group XML documents that contain the same section number (sno):
val(/doc/employee/department/@sno) 

Result: Documents A and C are handled as one group, and documents B and D are handled as another group.


Contents Index PreviousNext

All Rights Reserved, Copyright(C) FUJITSU LIMITED 2006