I am successfully parsing an xml document in javascript, having read it in via an XMLHttpRequest
I now want to grab one additional piece of info. The feed I'm reading contains this tag
<opensearch:totalResults>118</opensearch:totalResults>
How do I read the value it contains?
I've used Firefox's console to examine the xml doc's contents, looking in vain for where it's mentioned. Online searches don't help either.
Although not really relevant, the start of the heart of my code is:
var process = function (xml) {
var i, xmlDoc, table;
xmlDoc = xml.responseXML;
globXmlDoc = xmlDoc;
var myItemAsAnObject = [];
if (xmlDoc === null){
feedLength = 0;
} else {
feedLength = xmlDoc.getElementsByTagName("item").length;
if (feedLength == 0) { return false; }
var x = xmlDoc.getElementsByTagName("item");
The XML is
<rss version="2.0">
<channel>
<title>victoriana: Zazzle.com Store: Matching "victoriana"</title>
<link>http://feed.zazzle.com/z.2/api/find.aspx?qs=victoriana&ft=rss&ou=%2Frss%3Fqs%3Dvictoriana</link>
<description/>
<language>en-us</language>
<pubDate>Thu, 04 Jul 2019 17:26:55 GMT</pubDate>
<ttl>60</ttl>
<opensearch:totalResults>118</opensearch:totalResults>
<opensearch:startIndex>1</opensearch:startIndex>
<opensearch:itemsPerPage>60</opensearch:itemsPerPage>
<opensearch:Query role="request" searchTerms="victoriana"/>
<item>
:
:
:
A link to the entire xml doc is: rss feed
Note that the globxmlDoc is a global var just to let me look at it in the console.
I don't really know where to start....