Subversion Repositories XServices

Rev

Rev 160 | Details | Compare with Previous | 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>setAttribute</title>
9
	<para>Set an attribute into elements matched by an XPath expression.</para>
10
	<para>
11
	Sample request:
12
<programlisting language="xml"><![CDATA[
13
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.xservices.brutex.net">
14
   <soapenv:Header/>
15
   <soapenv:Body>
16
      <ws:setAttribute>
17
         <sourcexml>
18
         <![CDATA[<notes xmlns="http://demo.brutex.net">
19
	<note>
20
		<to>Lena</to>
21
		<from>Jani</from>
22
		<heading>Reminder ABC</heading>
23
		<body>Don't forget me this weekend!</body>
24
	</note>
25
	<note>
26
		<to>John</to>
27
		<from>Lena</from>
28
		<heading>Call Mr. ABC</heading>
29
		<body>Please call back</body>
30
	</note>
31
</notes>
32
]]]]><![CDATA[></sourcexml>
33
         <encoding>utf-8</encoding>
34
         <!--Optional:-->
35
         <namespaceList>
36
            <!--Zero or more repetitions:-->
37
            <namespace>
38
               <prefix>bx</prefix>
39
               <uri>http://demo.brutex.net</uri>
40
            </namespace>
41
         </namespaceList>
42
         <xpath>*/bx:note</xpath>
43
         <attribute>
44
            <name>priority</name>
45
            <!--Optional:-->
46
            <value>high</value>
47
         </attribute>
48
      </ws:setAttribute>
49
   </soapenv:Body>
50
</soapenv:Envelope>
51
]]></programlisting>
52
	Sample response:
53
	<programlisting language="xml"><![CDATA[
54
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
55
   <soap:Body>
56
      <ns2:setAttributeResponse xmlns:ns2="http://ws.xservices.brutex.net">
57
         <return><![CDATA[<?xml version='1.0' encoding='UTF-8'?>
58
         <notes xmlns="http://demo.brutex.net">
59
	<note xmlns:axis2ns16="http://demo.brutex.net" axis2ns16:priority="high">
60
		<to>Lena</to>
61
		<from>Jani</from>
62
		<heading>Reminder ABC</heading>
63
		<body>Don't forget me this weekend!</body>
64
	</note>
65
	<note xmlns:axis2ns17="http://demo.brutex.net" axis2ns17:priority="high">
66
		<to>John</to>
67
		<from>Lena</from>
68
		<heading>Call Mr. ABC</heading>
69
		<body>Please call back</body>
70
	</note>
71
</notes>]]]]><![CDATA[></return>
72
      </ns2:setAttributeResponse>
73
   </soap:Body>
74
</soap:Envelope>
75
]]></programlisting>
76
</para>
77
</section>