Subversion Repositories XServices

Rev

Rev 159 | Rev 163 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 159 Rev 160
Line 4272... Line 4272...
4272
      </ns2:replaceNodesResponse>
4272
      </ns2:replaceNodesResponse>
4273
   </soap:Body>
4273
   </soap:Body>
4274
</soap:Envelope>]]></programlisting>
4274
</soap:Envelope>]]></programlisting>
4275
</para>
4275
</para>
4276
</section>
4276
</section>
-
 
4277
		<section version="5.0" xml:base="XmlServices/selectXPath.xml" xmlns="http://docbook.org/ns/docbook" xmlns:xi="http://www.w3.org/2001/XInclude">
-
 
4278
	<title>selectXPath</title>
-
 
4279
	<para>Selects xmlfragements, nodes, attribute or text from xml data using an XPath expression.
-
 
4280
	This function requires namespaces to be declared correctly.</para>
-
 
4281
	<para>
-
 
4282
	Sample request:
-
 
4283
<programlisting language="xml"><![CDATA[
-
 
4284
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
-
 
4285
xmlns:ws="http://ws.xservices.brutex.net">
-
 
4286
   <soapenv:Header/>
-
 
4287
   <soapenv:Body>
-
 
4288
      <ws:selectXPath>
-
 
4289
         <sourcexml>
-
 
4290
         <![CDATA[<notes xmlns="http://demo.brutex.net" xmlns:bx="http://bx.brutex.net">
-
 
4291
	<bx:note>
-
 
4292
		<to>Lena</to>
-
 
4293
		<from>Jani</from>
-
 
4294
		<heading>Reminder ABC</heading>
-
 
4295
		<body>Don't forget me this weekend!</body>
-
 
4296
	</bx:note>
-
 
4297
	<note>
-
 
4298
		<to>John</to>
-
 
4299
		<from>Lena</from>
-
 
4300
		<heading>Call Mr. ABC</heading>
-
 
4301
		<body>Please call back</body>
-
 
4302
	</note>
-
 
4303
	<bx:note>
-
 
4304
		<to>Brian</to>
-
 
4305
		<from>JJohn</from>
-
 
4306
		<heading>Reminder XServices</heading>
-
 
4307
		<body>How to use selectXPath?</body>
-
 
4308
	</bx:note>
-
 
4309
</notes>
-
 
4310
]]]]><![CDATA[>
-
 
4311
		</sourcexml>
-
 
4312
         <encoding>utf-8</encoding>
-
 
4313
         <namespaceList>
-
 
4314
            <namespace>
-
 
4315
               <prefix>ns</prefix>
-
 
4316
               <uri>http://demo.brutex.net</uri>
-
 
4317
            </namespace>
-
 
4318
            <namespace>
-
 
4319
               <prefix>bx</prefix>
-
 
4320
               <uri>http://bx.brutex.net</uri>
-
 
4321
            </namespace>
-
 
4322
         </namespaceList>
-
 
4323
         <xpath>*/bx:note/ns:heading/text()</xpath>
-
 
4324
      </ws:selectXPath>
-
 
4325
   </soapenv:Body>
-
 
4326
</soapenv:Envelope>
-
 
4327
]]></programlisting>
-
 
4328
	Sample response:
-
 
4329
	<programlisting language="xml"><![CDATA[
-
 
4330
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
-
 
4331
   <soap:Body>
-
 
4332
      <ns2:selectXPathResponse xmlns:ns2="http://ws.xservices.brutex.net">
-
 
4333
         <return>
-
 
4334
            <stringlist>Reminder ABC</stringlist>
-
 
4335
            <stringlist>Reminder XServices</stringlist>
-
 
4336
            <size>2</size>
-
 
4337
         </return>
-
 
4338
      </ns2:selectXPathResponse>
-
 
4339
   </soap:Body>
-
 
4340
</soap:Envelope>
-
 
4341
]]></programlisting>
-
 
4342
</para>
-
 
4343
</section>
-
 
4344
		<section version="5.0" xml:base="XmlServices/setAttribute.xml" xmlns="http://docbook.org/ns/docbook" xmlns:xi="http://www.w3.org/2001/XInclude">
-
 
4345
	<title>setAttribute</title>
-
 
4346
	<para>Set an attribute into elements matched by an XPath expression.</para>
-
 
4347
	<para>
-
 
4348
	Sample request:
-
 
4349
<programlisting language="xml"><![CDATA[
-
 
4350
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.xservices.brutex.net">
-
 
4351
   <soapenv:Header/>
-
 
4352
   <soapenv:Body>
-
 
4353
      <ws:setAttribute>
-
 
4354
         <sourcexml>         
-
 
4355
         <![CDATA[<notes xmlns="http://demo.brutex.net">
-
 
4356
	<note>
-
 
4357
		<to>Lena</to>
-
 
4358
		<from>Jani</from>
-
 
4359
		<heading>Reminder ABC</heading>
-
 
4360
		<body>Don't forget me this weekend!</body>
-
 
4361
	</note>
-
 
4362
	<note>
-
 
4363
		<to>John</to>
-
 
4364
		<from>Lena</from>
-
 
4365
		<heading>Call Mr. ABC</heading>
-
 
4366
		<body>Please call back</body>
-
 
4367
	</note>
-
 
4368
</notes>
-
 
4369
]]]]><![CDATA[></sourcexml>
-
 
4370
         <encoding>utf-8</encoding>
-
 
4371
         <!--Optional:-->
-
 
4372
         <namespaceList>
-
 
4373
            <!--Zero or more repetitions:-->
-
 
4374
            <namespace>
-
 
4375
               <prefix>bx</prefix>
-
 
4376
               <uri>http://demo.brutex.net</uri>
-
 
4377
            </namespace>
-
 
4378
         </namespaceList>
-
 
4379
         <xpath>*/bx:note</xpath>
-
 
4380
         <attribute>
-
 
4381
            <name>priority</name>
-
 
4382
            <!--Optional:-->
-
 
4383
            <value>high</value>
-
 
4384
         </attribute>
-
 
4385
      </ws:setAttribute>
-
 
4386
   </soapenv:Body>
-
 
4387
</soapenv:Envelope>
-
 
4388
]]></programlisting>
-
 
4389
	Sample response:
-
 
4390
	<programlisting language="xml"><![CDATA[
-
 
4391
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
-
 
4392
   <soap:Body>
-
 
4393
      <ns2:setAttributeResponse xmlns:ns2="http://ws.xservices.brutex.net">
-
 
4394
         <return><![CDATA[<?xml version='1.0' encoding='UTF-8'?>         
-
 
4395
         <notes xmlns="http://demo.brutex.net">
-
 
4396
	<note xmlns:axis2ns16="http://demo.brutex.net" axis2ns16:priority="high">
-
 
4397
		<to>Lena</to>
-
 
4398
		<from>Jani</from>
-
 
4399
		<heading>Reminder ABC</heading>
-
 
4400
		<body>Don't forget me this weekend!</body>
-
 
4401
	</note>
-
 
4402
	<note xmlns:axis2ns17="http://demo.brutex.net" axis2ns17:priority="high">
-
 
4403
		<to>John</to>
-
 
4404
		<from>Lena</from>
-
 
4405
		<heading>Call Mr. ABC</heading>
-
 
4406
		<body>Please call back</body>
-
 
4407
	</note>
-
 
4408
</notes>]]]]><![CDATA[></return>
-
 
4409
      </ns2:setAttributeResponse>
-
 
4410
   </soap:Body>
-
 
4411
</soap:Envelope>
-
 
4412
]]></programlisting>
-
 
4413
</para>
-
 
4414
</section>
4277
		<section version="5.0" xml:base="XmlServices/wrapInCDATA.xml" xmlns="http://docbook.org/ns/docbook" xmlns:xi="http://www.w3.org/2001/XInclude">
4415
		<section version="5.0" xml:base="XmlServices/wrapInCDATA.xml" xmlns="http://docbook.org/ns/docbook" xmlns:xi="http://www.w3.org/2001/XInclude">
4278
	<title>wrapInCDATA</title>
4416
	<title>wrapInCDATA</title>
4279
	<para>Simply wraps any data fragment into &lt;![CDATA[ ... ]]&gt; section. This can be useful if you
4417
	<para>Simply wraps any data fragment into &lt;![CDATA[ ... ]]&gt; section. This can be useful if you
4280
	want to preserve indentation or line breaks.
4418
	want to preserve indentation or line breaks.
4281
	</para>
4419
	</para>