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.3 Searching by Numeric Value

A search expression is used to retrieve XML documents that satisfy specified conditions from the XML documents stored in Shunsaku.

Refer to B.3 Search Expressions for more information on search expressions.

It is possible to search for documents that meet conditions by comparing the size between the data in any element node of an XML document or the data in the attribute nodes of that element node and the numeric value of a keyword. For document searches using a numeric value, the character string in an element node in the XML document or the character string in the attribute nodes of that element node is treated as a numeric value. Therefore, unlike the size comparison search, the format of the character string need not be considered.

The data in the element node or the data in the attribute nodes of that element node specified by the path expression, text expression or attribute expression is treated as a numeric value and is compared to the numeric value specified by the keyword. The path expression, text expression or attribute expression and the search keyword are specified using a relational operator.

The following relational operators can be used: '=', '!=', '<', '<=', '>' and '>='.

The keyword is specified as a numeral not enclosed in quotes.

Refer to B.2.1 Path Expressions for more information on path expressions.

Refer to B.2.2 Text Expressions for more information on text expressions.

Refer to B.2.3 Attribute Expressions for more information on attribute expressions.

Refer to Numeric Values in B.3.2 Keywords for more information on numeric values and relational operators.

The explanation that follows assumes that Documents A and B, below exist:

Document A

<doc>
  <employee eno="19980120" position="general manager">
    <name>Sara Jones</name>
    <department sno="1001">Development Dep.</department>
    <phone>2201-1101</phone>
    <email> sara.jones@shunsaku.fujitsu.com.au</email>
  </employee>
  <basic date="2006/02/16" expense="$157.00">
    :
  </basic>
    :
  <detail>
    :
    <taxi>$13.60</taxi>
    :
  </detail>
</doc>

Document B

<doc>
  <employee eno="20012111" position="manager">
    <name>Lisa Taylor</name>
    <department sno="2002">Human Resource Dep.</department>
    <phone>2201-1204</phone>
    <email>lisa.taylor@shunsaku.fujitsu.com.au</email>
  </employee>
  <basic date="2006/02/18" expense="$85.00">
    :
  </basic>
    :
  <detail>
    :
    <taxi>$9.50</taxi>
    :
  </detail>
</doc>

Example 1

The following example shows how to search for documents in which the taxi fee (taxi) is cheaper (small) than $10.00.
/doc/detail/taxi < 10.00

Result: Document B is returned.

Example 2

The following example shows how to search for documents in which the section number (sno) is specified as 1001:
/doc/employee/department/@sno = 1001

Result: Document A is returned.


Contents Index PreviousNext

All Rights Reserved, Copyright(C) FUJITSU LIMITED 2006