0
以下の形式のデータがあり、Excelシートに類似のデータがあります。VBAでXMLファイルを解析する方法
<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>
私の要件は、ExcelデータとXMLデータを比較することです。具体的には、私の仕事は、以下の通りである:
- すべて
LegalEntityDataVORow
はすべてEstablishmentDataVORow
が多くRegistrationDataEtbVORow
含まれている多くのEstablishmentDataVORow
- 含まれています。ここ
は、私が直面している問題です。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
私のXMLファイルには、私は100 <LegalEntityDataVORow>
があります。 VBAで上記のタスクを実行するにはどうすればよいですか?
http://stackoverflow.com/questions/11305/how-to-parse-xml-using-vba – cullan
XMLは、ツリー構造の文書であり、Excelのデータはフラット、2です次元形式。だから、2つのコンテンツは類似している可能性はありません。表形式のExcelデータを表示してください。 – Parfait