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

Appendix B Format of Search, Return and Sort Expressions> B.3 Search Expressions

B.3.8 Filter Expressions

Filter expressions are used to specify search conditions within the closed range of element nodes specified by the path expressions.

The definition format for filter expressions is shown below.

[Figure B-18 Filter Expression Definition]

Example

An example search expression containing filter expressions is shown below.

Document A

<root>
  <company>
    <employee position="manager">
      <name>smith</name>
      <id>1000</id>
      <skill kind="0017">2005.1</skill>
      <skill kind="0023">2002.3</skill>
      <skill kind="0009">1998.8</skill>
</employee>
  </company>
  <company>
    <employee position="chief">
      <name>jones</name>
      <id>2000</id>
      <skill kind="0033">2004.7</skill>
      <skill kind="0012">2001.9</skill>
    </employee>
  </company>
</root>

Document B

<root>
  <company>
    <employee position="chief">
      <name>smith</name>
      <id>2000</id>
      <skill kind="0002">2003.2</skill>
      <skill kind="0010">2002.3</skill>
    </employee>
  </company>
  <company>
    <employee position="manager">
      <name>jones</name>
      <id>3000</id>
      <skill kind="0001">1995.2</skill>
    </employee>
  </company>
</root>

Search Expression 1

/root/company/employee{/name = '^smith' AND /id = '1000'}

Result

Document A matches the condition but Document B does not.

Treat '/root/company/employee' as a single block. Document A contains data that matches the conditions in braces (/name = '^smith' AND /id = '1000'), while Document B does not.

Search Expression 2

/root/company/employee{/@position = '^manager' AND /id = '3000'}

Result

Document B matches the condition but Document A does not.

Search Expression 3

/root/company/employee/skill{/@kind = '^0001' AND /text() = '1995.2'}

Result

Document B matches the condition but Document A does not.


Contents Index PreviousNext

All Rights Reserved, Copyright(C) FUJITSU LIMITED 2006