# Parse XML in classic ASP



## fk-wholesale-ltd (Nov 19, 2011)

I'm trying to parse XML in classic ASP. The following code displays the XML file sequentially. What's the best way to access the fields <Product> and <SKU>?


```
<%
Dim mydoc
Set mydoc=Server.CreateObject("Microsoft.XMLDOM")

mydoc.load(Server.MapPath("xml.xml"))
set nodes = mydoc.selectNodes("//*")

for i = 0 to nodes.length - 1
    response.write(nodes(i).nodeName & " - " & nodes(i).text & "<br />")
next
%>


xml file
--------
<?xml version="1.0" standalone="yes"?>
<NewDataSet>
  <Table>
    <Product>Test1</Product>
    <SKU>AAA</SKU>
  </Table>
  <Table>
    <Product>Test2</Product>
    <SKU>BBB</SKU>
  </Table>
</NewDataSet>
```


----------

