Note that there are some explanatory texts on larger screens.

plurals
  1. PORetrieve a specific node from a $(xData.responseXML) object
    primarykey
    data
    text
    <p>I'm completely stuck in retrieving a specific node from a responseXML object that I got back from the <code>GetUserProfileByName</code> (SharePoint / SPServices). I need a specific <code>PropertyData</code> node (in the example "FirstName") and then retrieve the value of the "FirstName". Retrieving the value is not a problem, retrieving the specific node is...</p> <p>Below a part from the returned XML (for the sake of the example I stripped some properties):</p> <pre><code>... &lt;PropertyData&gt; &lt;Name&gt;UserProfile_GUID&lt;/Name&gt; &lt;Values&gt; &lt;ValueData&gt; &lt;Value xmlns:q1="..."&gt;206b47c7-cfdc-...&lt;/Value&gt; &lt;/ValueData&gt; &lt;/Values&gt; &lt;/PropertyData&gt; &lt;PropertyData&gt; &lt;Name&gt;FirstName&lt;/Name&gt; &lt;Values&gt; &lt;ValueData&gt; &lt;Value xsi:type="xsd:string"&gt;Maarten&lt;/Value&gt; &lt;/ValueData&gt; &lt;/Values&gt; &lt;/PropertyData&gt; ... </code></pre> <p>Since I know that I need the property <code>FirstName</code>, I do not want to iterate through the entire set of <code>PropertyData</code> nodes until I've the correct one (slow). In XPath I can select <code>FirstName</code> just by saying:</p> <pre><code>//PropertyData[Name='FirstName']/Values/ValueData/Value </code></pre> <p>However, I cannot do that in the <code>xData.responseXML</code> object. I tried the following filter, finds and other things (in all kinds of variations):</p> <pre><code>$(xData.responseXML).SPFilterNode("PropertyData").find("[Name*=FirstName]") $(xData.responseXML).SPFilterNode("PropertyData").find("[Name*='FirstName']") $(xData.responseXML).SPFilterNode("PropertyData").filter("[Name*=FirstName]") $(xData.responseXML).SPFilterNode("PropertyData[Name='FirstName']") </code></pre> <p>I did many searches, but was not able to find an answer. There were many partial answer which a I all tried, but were not working. Any one a clue...</p> <p>Thanks in advance! Maarten</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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