Subversion Repositories XServices

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
160 brianR 1
<?xml version='1.0' encoding='utf-8'?>
2
<!DOCTYPE section [
3
<!ENTITY % myent SYSTEM "../entities.ent">
4
%myent;
5
]>
6
<section xmlns="http://docbook.org/ns/docbook" version="5.0"
7
	xmlns:xi="http://www.w3.org/2001/XInclude">
8
	<title>selectXPath</title>
9
	<para>Selects xmlfragements, nodes, attribute or text from xml data using an XPath expression.
10
	This function requires namespaces to be declared correctly.</para>
11
	<para>
12
	Sample request:
13
<programlisting language="xml"><![CDATA[
14
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
15
xmlns:ws="http://ws.xservices.brutex.net">
16
   <soapenv:Header/>
17
   <soapenv:Body>
18
      <ws:selectXPath>
19
         <sourcexml>
20
         <![CDATA[<notes xmlns="http://demo.brutex.net" xmlns:bx="http://bx.brutex.net">
21
	<bx:note>
22
		<to>Lena</to>
23
		<from>Jani</from>
24
		<heading>Reminder ABC</heading>
25
		<body>Don't forget me this weekend!</body>
26
	</bx:note>
27
	<note>
28
		<to>John</to>
29
		<from>Lena</from>
30
		<heading>Call Mr. ABC</heading>
31
		<body>Please call back</body>
32
	</note>
33
	<bx:note>
34
		<to>Brian</to>
35
		<from>JJohn</from>
36
		<heading>Reminder XServices</heading>
37
		<body>How to use selectXPath?</body>
38
	</bx:note>
39
</notes>
40
]]]]><![CDATA[>
41
		</sourcexml>
42
         <encoding>utf-8</encoding>
43
         <namespaceList>
44
            <namespace>
45
               <prefix>ns</prefix>
46
               <uri>http://demo.brutex.net</uri>
47
            </namespace>
48
            <namespace>
49
               <prefix>bx</prefix>
50
               <uri>http://bx.brutex.net</uri>
51
            </namespace>
52
         </namespaceList>
53
         <xpath>*/bx:note/ns:heading/text()</xpath>
54
      </ws:selectXPath>
55
   </soapenv:Body>
56
</soapenv:Envelope>
57
]]></programlisting>
58
	Sample response:
59
	<programlisting language="xml"><![CDATA[
60
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
61
   <soap:Body>
62
      <ns2:selectXPathResponse xmlns:ns2="http://ws.xservices.brutex.net">
63
         <return>
64
            <stringlist>Reminder ABC</stringlist>
65
            <stringlist>Reminder XServices</stringlist>
66
            <size>2</size>
67
         </return>
68
      </ns2:selectXPathResponse>
69
   </soap:Body>
70
</soap:Envelope>
71
]]></programlisting>
72
</para>
73
</section>