Print Page | Close Window

ASP/XML query

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=14940
Printed Date: 30 March 2026 at 10:06am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: ASP/XML query
Posted By: bootcom
Subject: ASP/XML query
Date Posted: 04 May 2005 at 12:05am
Hi,
 
I'm extremely new to XML and I have to be honest the thing is confusing the absolute bejesus outta me. Im ok when I'm adding normal records, however, Im experiencing problems (ie I aint got a clue) when Im trying to add an attribute to the tag.
 

<skin id="1">
 
I've been trying to do this for like a day now and am going round in circles and all my searches on google are leading me to a blank. Please help guys !!!
 
Cheers



Replies:
Posted By: Phat
Date Posted: 04 May 2005 at 12:52am
What is the problem you're having?

use Response.Write("<skin id=""1"">")


Posted By: bootcom
Date Posted: 04 May 2005 at 12:54am
Sorry. I dont think I made it too clear. I am writing to XML with ASP using an HTML form. I can write all of the tags but I cant attributes to them. I just need to know how to do this.
 
Many thanks


Posted By: Phat
Date Posted: 04 May 2005 at 12:57am
can you post the bit of code that giving you problems


Posted By: bootcom
Date Posted: 04 May 2005 at 1:03am
Aye sure
 

' Set the ID of the record

set nodeID = indexFile.createNode(1,"emote_id","")

set nodeText = indexFile.createTextNode(idArticle+1)

nodeID.appendChild(nodeText)
 
' Set the group ID this user must be a member of to use this emote

set nodeGroupID = indexFile.createNode(1,"emote_rank","")

set nodeGroupText = indexFile.createTextNode(intMinimumRank)

nodeGroupID.appendChild(nodeGroupText)
 
Instead of it writing standard XML syntax like this:
 

<skin_database>
  <skin>
    <id>some id</id>
  </skin>
</skin_database>
 
I want it to write with the attribute in the skin tag ... like this
 

<skin_database>
  <skin id="some id">
  </skin>
</skin_database>
 
I didn't want to revert back the first way because it looks neater in the second example. I know there's a way to do it but I just don't know what that way is and its bugging me now LOL.


Posted By: Demon
Date Posted: 05 May 2005 at 10:21pm
Check out www.w3schools.com
They have an awesome XML Tutorial. And the thing you'll be looking for is the .setAttribute function.

-------------
So Sayith the Demon.


Posted By: bootcom
Date Posted: 06 May 2005 at 4:22am
Yeah, that was one of the first places I checked, but when I tried to use it it kept coming up with errors. I've even checked MSDN and that didn't work either. This is just too depressing LOL.



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