I have data in the below format and have similar data in Excel sheet.
<LegalEntityDataVO>
<LegalEntityDataVORow>
<Name>Siemens Corporation</Name>
<LegalEntityIdentifier>010</LegalEntityIdentifier>
<EstablishmentData>
<EstablishmentDataVORow>
<MainEstablishmentFlag>Y</MainEstablishmentFlag>
<Name>Siemens Corporation</Name>
<GeographyCode>US</GeographyCode>
<RegistrationDataEtb>
<RegistrationDataEtbVORow>
<SourceTable>XLE_ETB_PROFILES</SourceTable>
<Name>United States Income Tax</Name>
</RegistrationDataEtbVORow>
<RegistrationDataEtbVORow>
<SourceTable>XLE_ETB_PROFILES</SourceTable>
<Name>United States Federal Tax</Name>
</RegistrationDataEtbVORow>
</RegistrationDataEtb>
</EstablishmentDataVORow>
</EstablishmentData>
<EstablishmentData>
<EstablishmentDataVORow>
<MainEstablishmentFlag>Y</MainEstablishmentFlag>
<Name>US Corporation</Name>
<GeographyCode>US</GeographyCode>
<RegistrationDataEtb>
<RegistrationDataEtbVORow>
<SourceTable>XLE_ETB_PAYBLES</SourceTable>
<Name>United States Service Tax</Name>
</RegistrationDataEtbVORow>
<RegistrationDataEtbVORow>
<SourceTable>XLE_ETB_PAYBLES</SourceTable>
<Name>United States Oil Tax</Name>
</RegistrationDataEtbVORow>
</RegistrationDataEtb>
</EstablishmentDataVORow>
</EstablishmentData>
</LegalEntityDataVORow>
<LegalEntityDataVO>
So my requirement is to compare the Excel data with XML data. Specifically, my task is described below:
If **LegalEntityIdentifier** value in Excel = **LegalEntityIdentifier** value in xml then
(
If(**MainEstablishmentFlag** value in Excel = **MainEstablishmentFlag** value in Xml then
(
Compare **Name** in Excel with **Name** in XML
)
)
**LegalEntityIdentifier** childnode of LegalEntityDataVORow
**MainEstablishmentFlag** childnode of EstablishmentDataVORow
**Name** childnode of RegistrationDataEtbVORow
Here are the problems I face:
- Every
LegalEntityDataVORow
contains manyEstablishmentDataVORow
- Every
EstablishmentDataVORow
contains manyRegistrationDataEtbVORow
.
In my XML file I have 100 <LegalEntityDataVORow>
. How do I run the above task in VBA?