Click to See Complete Forum and Search --> : extract from XML


waqas1
July 4th, 2002, 01:49 AM
hi all,
i have an XML file where the information is stored as given below, now i want to get the information where intakeid = "DF1111" and courseName = "OS"how to do it using Visual Basic 6.0 ?

<details>
<intake intakeid ="DF1111" teacher_id ="SGN" startingweek="12/31/2001" endingweek="4/8/2002" courseName = "MT"></intake>
<intake intakeid ="DF1111" teacher_id ="RK" startingweek="12/31/2001" endingweek="4/8/2002" courseName = "OS"></intake>
<intake intakeid ="DF1111" teacher_id ="SN" startingweek="12/31/2001" endingweek="4/8/2002" courseName = "CSA"></intake>
</details>


Thanks
waqas

dkar
July 5th, 2002, 01:04 AM
Hi
It is in JS, just change syntax.

xml = new ActiveXObject("Msxml2.DOMDocument");
xml.load(urlOrFile);
nodeList = xml.selectNodes('//details/intake[intaked="DF1111" and courseName = "OS"]');


nodeList.length - count of nodes
nodeList.item(i) - node

waqas1
July 5th, 2002, 01:45 AM
Thanks dkar...

waqas1
July 9th, 2002, 02:56 AM
hi dKar,

can u please help me with same thing above in Java using sax or dom....?

thanks
waqas