Interstage Shunsaku Data Manager Application Development Guide - Microsoft(R) Windows(R) 2000/ Microsoft(R) Windows Server(TM) 2003 - - UNIX - |
Contents
Index
![]() ![]() |
Part 1 The Basic for Developing Application | > Chapter 3 Data Search Methods | > 3.6 Extracting Search Results | > 3.6.1 Extracting Data in XML Format |
It is possible to specify a path expression in the return parameter to extract data under any node of an XML document in XML format. The data in the element node indicated by the path expression is expressed in XML format as an element under the root tag of the XML document.
The explanations accompanying the following examples assume that the following single XML document has been found using a search expression.
<doc> <employee> <eno>19980120</eno> <name>Sara Jones</name> <sno>1001</sno> <phone>2201-1101</phone> <email>sara.jones@shunsaku.fujitsu.com.au</email> </employee> <basic> <date>2006/02/16</date> <expense>$72.00</expense> </basic> <detail> <destination>Head Office</destination> <area>Clearview, Belair, Adelaide</area> <purpose>Regular project meeting</purpose> <train>$66.00</train> <taxi>$6.00</taxi> <hotel></hotel> <comment>None</comment> </detail> <report>Must create and report a sales results chart by next meeting</report> </doc> |
Example 1
The following example shows how to extract the employee's name (name).
/doc/employee/name
More than one return parameter can be specified in the return expression. Each path expression must be separated using a comma.
Example 2
The following example shows how to extract the employee name (name), basic information (basic) and the trip purpose (purpose).
/doc/employee/name,/doc/basic,/doc/detail/purposeResult
<doc><name>Sara Jones</name><basic> <date>2006/02/16</date> <expense>$72.00</expense> </basic><purpose>Regular project meeting</purpose></doc>
When a sort expression is specified, XML documents found using the search expression will be returned in the order determined by the sort expression.
In these situations, either extract the entire XML document, or extract data using a specification where the return parameter isolates a single element.
Contents
Index
![]() ![]() |