I have been dealling with XML a lot lately and becasue of that I am trying to get better in it. My XML file looks like the following...
<main>
<sec1>
<part1>Name1</part1>
<part2>Name2</part2>
</sec1>
<sec2>
<part3>Name1</part3>
<part4>Name2</part4>
</sec2>
</main>
I want use ASP to write the value. I mean I want to be able to target saying sec1.part1.text will give me Name1. I can actually do it by using the following code. But I am going to have duplicate names under each section and that will creates name problems.
Set xml = Server.CreateObject("Microsoft.XMLDOM")
xml.async = False
xml.load (Server.MapPath("page.xml"))
sec1 = xml.documentElement.childNodes(part1).text
Again what I want to do is
sec1 = xml.documentElement.sec1.part1.text
Edited by vshriniwasan