Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>While the provider is using multiple namespaces (signified by <code>m:</code> and <code>d:</code> in front of element names), you can ignore them for retrieving the data you're interested in.</p> <p>Once you've called <code>getElement()</code> to get the root of the XML doc, you can navigate through the rest using attribute names. (Stop after <code>var feed = ...</code> in the debugger, and explore feed, you'll find you have the entire XML document there</p> <p><img src="https://i.stack.imgur.com/Kbn0h.png" alt="Debugger view"></p> <p>Try this:</p> <pre><code> var text = Xml.parse(resp,true); var feed = text.getElement(); var urls = []; for (var i in feed.entry) { urls.push(feed.entry[0].content.properties.MediaUrl.Text); } Logger.log(urls); </code></pre> <p>This also works. Note that you have multiple entries in your response, and this example is going after the second of them:</p> <pre><code>var ggg = Xml.parse(resp,true) .getElement() .getElements('entry')[1] .getElement('content') .getElement('properties') .getElement('MediaUrl') .getText(); </code></pre> <h3>References</h3> <ul> <li><a href="http://www.w3.org/TR/REC-xml-names/" rel="nofollow noreferrer">Namespaces in XML 1.0</a></li> <li>XmlElement methods referencing namespace, such as <a href="https://developers.google.com/apps-script/reference/xml/xml-element#getElement%28String,String%29" rel="nofollow noreferrer">getElement(namespaceName, localName)</a></li> <li>Other relevant StackOverflow questions. <a href="https://stackoverflow.com/questions/1792270/xml-element-name-with-colon">xml element name with colon</a>, <a href="https://stackoverflow.com/search?q=xml%20namespace">lots about XML namespaces</a></li> </ul>
 

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