I'm working through borrowed code to understand how it parses XML and how bits of data are being found. I've very new to XML and parsing so apologies in advance if this is a basic question.
When I look at oNotelist2 in the Watch window I can see it has Item(1), Item(2), Item(3) and Item(4) but I don't understand:
1: Where is Item(0) (which I think is where it should be seeking @contextRef)?
2: Where is the value of strContextID = 'I2013Q4' being found?
Thanks in advance for your help.
When I look at oNotelist2 in the Watch window I can see it has Item(1), Item(2), Item(3) and Item(4) but I don't understand:
1: Where is Item(0) (which I think is where it should be seeking @contextRef)?
2: Where is the value of strContextID = 'I2013Q4' being found?
Code:
Sub tester2()
Dim oInstance As MSXML2.DOMDocument60
Dim m_strUSGAAP_TaxonomyVersion As String
Dim m_strInvest_TaxonomyVersion As String
Dim m_strDEI_TaxonomyVersion As String
Dim oNodelist2 As MSXML2.IXMLDOMNodeList
Dim strContextID As String
Dim i As Long
Set oInstance = New MSXML2.DOMDocument60
oInstance.async = False
oInstance.validateOnParse = False
oInstance.Load "http://www.sec.gov/Archives/edgar/data/1143908/000114390813000035/ck0001143908-20130831.xml"
m_strUSGAAP_TaxonomyVersion = "http://fasb.org/us-gaap/2012-01-31"
m_strInvest_TaxonomyVersion = "http://xbrl.sec.gov/invest/2012-01-31"
m_strDEI_TaxonomyVersion = "http://xbrl.sec.gov/dei/2012-01-31"
oInstance.setProperty "SelectionNamespaces", "xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xbrli='http://www.xbrl.org/2003/instance' xmlns='http://www.xbrl.org/2003/instance' xmlns:xbrldi='http://xbrl.org/2006/xbrldi' xmlns:us-gaap='" & m_strUSGAAP_TaxonomyVersion & "' xmlns:dei='" & m_strDEI_TaxonomyVersion & "' xmlns:currency='http://xbrl.sec.gov/currency/2012-01-31' xmlns:invest='" & m_strInvest_TaxonomyVersion & "'"
Set oNodelist2 = oInstance.SelectNodes("//us-gaap:Assets | //us-gaap:AssetsCurrent | //us-gaap:LiabilitiesAndStockholdersEquity")
i = 0
strContextID = oNodelist2.Item(i).SelectSingleNode("@contextRef").Text
Debug.Print strContextID
End Sub
Thanks in advance for your help.