Note that there are some explanatory texts on larger screens.

plurals
  1. POHTTP Post String with Same Parent Name
    text
    copied!<p>I have created an http post request using rails and HTTParty, which is as follows...</p> <pre><code>xml = "&lt;Member&gt;&lt;Telephone-group&gt;&lt;Value&gt;&lt;PhoneNumber&gt;&lt;/PhoneNumber&gt;&lt;/Value&gt;&lt;/Telephone-group&gt;&lt;/Member&gt;" DeleteNumber.post("http://url/path/members/" + msid + "?securityKey=securitykey", :query =&gt; {:newValues =&gt; xml}) </code></pre> <p>The aim is to remove the existing mobile(cell) phone number from the database by posting a blank string, which works fine. However, in the XML document that I am posting to, there are often multiple types of phone number, including home and work numbers. Unfortunately, they are all named the same, as follows...</p> <pre><code>&lt;Telephone-group type="associated" writable="true"&gt; &lt;Value&gt; &lt;PhoneNumber&gt;01234567891&lt;/PhoneNumber&gt; &lt;PhoneType&gt;H&lt;/PhoneType&gt; &lt;PhoneTypeDesc writable="false"&gt;Home&lt;/PhoneTypeDesc&gt; &lt;/Value&gt; &lt;Value&gt; &lt;PhoneNumber&gt;07123456789&lt;/PhoneNumber&gt; &lt;PhoneType&gt;M&lt;/PhoneType&gt; &lt;PhoneTypeDesc writable="false"&gt;Mobile&lt;/PhoneTypeDesc&gt; &lt;/Value&gt; &lt;/Telephone-group&gt; </code></pre> <p>How can I specify that it only remove the mobile phone number? I know how this would be done using xpath, probably something like "<strong>(//phonenumber)[..//phonetype = "M"]</strong>", but I do not know how I can specify this using an http post parameter. Any help is much appreciated, many thanks!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload