I'm using MSXML2 to load an XML file (a feed from Google Analytics).
I now need to get data out of it, but I can't figure out how.
This is the XML:
<?xml version='1.0' encoding='utf-8'?>
<feed xmlns='http://www.w3.org/2005/Atom' xmlns:dxp='http://schemas.google.com/analytics/2009' xmlns:openSearch='http://a9.com/-/spec/opensearch/1.1/' xmlns:gd='http://schemas.google.com/g/2005' gd:etag='W/"dsdsdsdsdsdsdsd."' gd:kind='analytics#data'>
<id>http://www.google.com/analytics/feeds/data?ids=ga:2000000&amp;dimensions=ga:campaign&amp;metrics=ga:visits&amp;filters=ga:campaign%3D%3Dcrosspromo&amp;start-date=2010-08-26&amp;end-date=2010-09-09</id>
<updated>2010-09-09T05:50:40.705-07:00</updated>
<title>Google Analytics Data for Profile 2000000</title>
<link rel='self' type='application/atom+xml' href='https://www.google.com/analytics/feeds/data?max-results=50&amp;end-date=2010-09-09&amp;start-date=2010-08-26&amp;metrics=ga%3Avisits&amp;ids=ga%3A2000000&amp;dimensions=ga%3Acampaign&amp;filters=ga%3Acampaign%3D%3Dcrosspromo' />
<author>
<name>Google Analytics</name>
</author>
<generator version='1.0'>Google Analytics</generator>
<openSearch:totalResults>1<
/openSearch:totalResults>
<openSearch:startIndex>1</openSearch:startIndex>
<openSearch:itemsPerPage>50</openSearch:itemsPerPage>
<dxp:aggregates>
<dxp:metric confidenceInterval='0.0' name='ga:visits' type='integer' value='5070' />
</dxp:aggregates>
<dxp:dataSource>
<dxp:property name='ga:profileId' value='2000000' />
<dxp:property name='ga:webPropertyId' value='UA-2000000-1' />
<dxp:property name='ga:accountName' value='test' />
<dxp:tableId>ga:2000000</dxp:tableId>
<dxp:tableName>test</dxp:tableName>
</dxp:dataSource>
<dxp:endDate>2010-09-09</dxp:endDate>
<dxp:startDate>2010-08-26</dxp:startDate>
<entry gd:etag='W/"CkMEQX47eSp7I2A9Wx5QGUQ."' gd:kind='analytics#datarow'>
<id>http://www.google.com/analytics/feeds/data?ids=ga:2000000&amp;ga:campaign=crosspromo&amp;filters=ga:campaign%3D%3Dcrosspromo&amp;start-date=2010-08-26&amp;end-date=2010-09-09</id>
<updated>2010-09-08T17:00:00.001-07:00</updated>
<title>ga:campaign=crosspromo</title>
<link rel='alternate' type='text/html' href='http://www.google.com/analytics' />
<dxp:dimension name='ga:campaign' value='crosspromo' />
<dxp:metric confidenceInterval='0.0' name='ga:visits' type='integer' value='5070' />
</entry></openSearch:totalResults>
</feed>
Then I load the XML and search for the "entry" tag:
Dim objXML As MSXML2.DOMDocument
Set objXML = New MSXML2.DOMDocument
objXML.loadXML strXML
Debug.Print objXML.getElementsByTagName("entry").Item(0).Text
But this outputs:
http://www.google.com/analytics/feeds/data?ids=ga:20000000&ga:campaign=crosspromo&filters=ga:campaign%3D%3Dcrosspromo&start-date=2010-08-26&end-date=2010-09-092010-09-08T17:00:00.001-07:00ga:campaign=crosspromo
Where's the rest of the data? If I try item(1) it fails...