Arraylist + XML

Hello, everybody!

I have big problem:

I have informaton from two different xml files.

I get specified node by using GetElementsByTagName("appName");

I will then put this information in arraylist: arraylistA, arraylistB.

Then I compare the arraylist to find the difference. And the deference is also in an arraylist.

MY QUESTION IS HOW DO I IDENTIFED ALL THE ANOTHER NODES IN THAT ARRAYLIST:

Example:

<appsTable xmlns="http://tempuri.org/apps.xsd">
<application>
<appName>Microsoft Office Professional Edition 2003</appName>
<appInstallCmd>c:\WINDOWS\system32\MsiExec.exe</appInstallCmd>
<appVersionLocKey>SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{90110409-6000-11D3-8CFE-0150048383C9}</appVersionLocKey>
<appVersionLocValue>DisplayVersion</appVersionLocValue>
</application>
<application>


<appName>Adobe Reader</appName>
<appInstallCmd>c:\WINDOWS\system32\MsiExec.exe</appInstallCmd>
<appVersionLocKey>SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{AC76BA86-7AD7-1033-7646-A70000000000}</appVersionLocKey>
<appVersionLocValue>DisplayVersion</appVersionLocValue>
</application>

AFTER I COMPARE THE THE ARRAYLIST, THE RESULT IS:

Microsoft Office Professional Edition 2003

Adobe Reader

MY QUESTION IS HOW DO I ALSO GET THE appVersionLocKey associated with each node:So it will look like this:

Microsoft Office Professiona,SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{AC76BA86-7AD7-1033-7646-A70000000000

Adobe Reader,SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{AC76BA86-7AD7-1033-7646-A70000000000



Answer this question

Arraylist + XML

  • JCL

    Q1: Take one by one nodes in arraylistA and compare them to nodes arraylistB if you find that node is in both lists it is yours.

    Q2: arraylistA [ i ] .SelectSingleNode("appVersionLocKey/text()").Value



  • Arraylist + XML