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.2 Searching with Character Strings> 3.2.1 Searching for Documents that Contain a Keyword

3.2.1.1 An Example of the Path Expressions, Text Expressions or Attribute Expressions

The section explains how to specify the path expressions, text expression or attribute expressions.

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 Patterns in B.3.2 Keywords for more information on partial matches and relational operators.

Example 1

Search for documents containing the keyword 'Shunsaku' in the trip purpose (purpose):
/doc/detail/purpose = 'Shunsaku'

Result:Document A is returned.

If '//' is specified in the path expression, a search can be performed on all levels of element nodes under the element node represented by the path value preceding the '//'. By specifying '*' in the path expression, searches can be performed using all of the element nodes immediately under any element node as the search target.

The '//' specification is a useful way to find documents that contain the search keyword in any element node of an entire XML document, and not just in a specific element node.

Example 2

Search for documents containing the keyword 'Sales Meeting' somewhere in the detailed information (detail):
/doc/detail/* = 'Sales meeting'

Result:Document C is returned.

Example 3

Search for documents containing the keyword 'installation report' somewhere in the XML document:
/doc// = 'installation report'

Result:Document B is returned.

The '//' specification is useful when the target element nodes can be uniquely determined without having to express a hierarchical structure.

Example 4

Search for documents containing the keyword 'Sydney' in the trip destination (destination):
//destination = 'Sydney'

Result:Document B is returned.


Contents Index PreviousNext

All Rights Reserved, Copyright(C) FUJITSU LIMITED 2006