how to extract this node??

admin

Administrator
Staff member
Hi All

Here is short version of my XML file:

========================================
<?xml version="1.0" encoding="utf-8" ?>
- <CountriesCities>
- <Countries>
<CoID>111</CoID>
<Country>ALBANIA</Country>
<Cities CiID="1478" City="TIRANA" />
</Countries>
- <Countries>
<CoID>1</CoID>
<Country>AUSTRALIA</Country>
<Cities CiID="1" City="ADELAIDE" />
<Cities CiID="4" City="MELBOURNE" />
<Cities CiID="6" City="SYDNEY" />
</Countries>
- <Countries>
========================================

Using the ASP code below I manage to get Country ID and Country Name and to display them on the (ASP) page.

========================================

Set objXMLDoc = CreateObject("Microsoft.XMLDOM")
objXMLDoc.async = False
objXMLDoc.load Server.MapPath("../test/countries.xml")

Set NodeList2 = objXMLDoc.getElementsByTagName("CoID")
Set NodeList = objXMLDoc.getElementsByTagName("Country")


numNodes2 = NodeList2.Length

For i = 1 To NumNodes2
Set CurrNode2 = NodeList2.nextNode
Set CurrNode = NodeList.nextNode
Response.Write "CountryID=" & CurrNode2.text
Response.Write "Country Name=" & CurrNode.text
Next

========================================
My Problem:


I would like to do same with cities? How to display City ID (CiID) and City Name?

Regards, Zoreli
 
Back
Top