Print Page | Close Window

Writing XML Into Page

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=5250
Printed Date: 28 March 2026 at 3:44pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Writing XML Into Page
Posted By: vshriniwasan
Subject: Writing XML Into Page
Date Posted: 24 August 2003 at 2:01pm

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




Replies:
Posted By: vshriniwasan
Date Posted: 28 August 2003 at 11:47am
So, no one has any idea about this problem...



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net