Chance1234
IS-IT--Management
An extension to my earlier question,
What I am trying to do is move down to the CTC Section and move through the records, I have been playing around with childnodes/nextsiblings/
Chance,
Filmmaker, taken gentleman and He tan e epi tas
Code:
<?xml version="1.0"?>
<TAXPACKS>
<CLIENT CLIENTNO='37509'>
<CLIENTTYPE>1</CLIENTTYPE>
<CLIENTWRAPNO>200037</CLIENTWRAPNO>
<CTC>
<RECORD>
<CTCHEADING>Interest UK Companies</CTCHEADING>
<DATA>
<PAYDATE>01/02/2005</PAYDATE>
<STOCK>Made Up company Acc</STOCK>
<HOLDING>1211.19</HOLDING>
<RATE>0.016</RATE>
<GROSS>186.670625463221</GROSS>
<TAX>167.29</TAX>
<NET>19.37904</NET>
<EQUALISATION>0</EQUALISATION>
</DATA>
<DATA>
<PAYDATE>30/08/2005</PAYDATE>
<STOCK>New Made Up Bond Inc</STOCK>
<HOLDING>103.55</HOLDING>
<RATE>0.5</RATE>
<GROSS>498.728091451292</GROSS>
<TAX>446.95</TAX>
<NET>51.775</NET>
<EQUALISATION>0</EQUALISATION>
</DATA>
</RECORD>
<RECORD>
<CTCHEADING>DIVIDENDS UK Companies</CTCHEADING>
<DATA>
<PAYDATE>01/02/2005</PAYDATE>
<STOCK>Made Up company Acc</STOCK>
<HOLDING>1211.19</HOLDING>
<RATE>0.016</RATE>
<GROSS>186.670625463221</GROSS>
<TAX>167.29</TAX>
<NET>19.37904</NET>
<EQUALISATION>0</EQUALISATION>
</DATA>
</RECORD>
</CTC>
</CLIENT>
</TAXPACKS>
What I am trying to do is move down to the CTC Section and move through the records, I have been playing around with childnodes/nextsiblings/
Code:
Sub testingFORctc()
Dim xml_doc As New DOMDocument
Dim nde_Client As IXMLDOMNode
Dim nde_CTC As IXMLDOMElement
Dim nde_item As IXMLDOMElement
Dim x As Variant
'On Error Resume Next
xml_doc.Load str_XMLPath & "TaxPackBatch.xml"
Set nde_Client = xml_doc.documentElement
For Each nde_Client In nde_Client.selectNodes("//CLIENT [@CLIENTNO='37509']")
For Each nde_CTC In nde_Client.selectNodes("CTC").childNodes
If nde_CTC.selectSingleNode("CTC HEADING").Text = "INTEREST UK COMPANIES" Then
'Run Interest code
ElseIf nde_CTC.selectSingleNode("CTC HEADING").Text = "Dividends UK COMPANIES" Then
'run Dividend code
End If
Next
Next
Set xml_doc = Nothing
End Sub
Chance,
Filmmaker, taken gentleman and He tan e epi tas