Skip to content

AddNamespace

Adds a namespace to the xml node with the given prefix and uri.

1
myXml.AddNamespace(prefix: string, ns: string):void

Parameters

string prefix
    Prefix to add the namespace.

string ns
    Namespace URI to specify the namespace.

Remarks

Making a SOAP Call

1
2
3
var services = $Services.ServiceCards.ServiceCardsSoap.Get({
   key: key,
});

SOAP Call Response

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
<GetResponse xmlns="http://tempuri.org/">
  <GetResult>
    <Item>
      <Id>9901</Id>
      <Name>Maintenance Service</Name>
      <VAT>18</VAT>
      <FirmNr>67</FirmNr>
    </Item>
    <Item>
      <Id>9902</Id>
      <Name>Cleaning Service</Name>
      <VAT>8</VAT>
      <FirmNr>68</FirmNr>
    </Item>
  </GetResult>
</GetResponse>

Register namespace and query

1
2
3
4
services.AddNamespace('tmp', 'http://tempuri.org/');
services.SelectAll('tmp:GetResult/tmp:Item', function(item) {
    // do sth with the selected node
});