Hi. I'm using ASP/vbscript to append elements and associated attributes to an xml file. Both the element values and attribute value come from a form. The problem i have is that i can't get the relevant form entry assigned to the attribute value. This is what i have. The relevant parts are in bold.

Code:
<%

dim xid
dim xstatus
dim xsurname
dim xforename
dim xaddress
dim xemail
dim xhometelno
dim xmobiletelno
dim xworktelno

set xid = Request.Form("id")
set xstatus = Request.Form("status")
set xsurname = Request.Form("surname")
set xforename = Request.Form("forename")
set xaddress = Request.Form("address")
set xemail = Request.Form("email")
set xhometelno = Request.Form("hometelno")
set xmobiletelno = Request.Form("mobiletelno")
set xworktelno = Request.Form("worktelno")

Set objXML = server.CreateObject("Microsoft.XMLDOM")
objXML.async = False
objXML.load(server.MapPath("phonebooktest.xml"))

set objphonebook = objXML.documentElement
set objperson = objXML.createElement ("person")
objperson.setAttribute "id", xid
the problem is in the line above. the DOM states that the method must be used in the form xxxx.setAttribute "attribute_name" "value of attribute" and the quotes must be included so when i put the variable xid as opposed to an absolute value such as "xid" it simply ignores it.
objphonebook.appendChild objperson
set objpersonstatus = objXML.createElement("status") objperson.appendchild objpersonstatus objpersonstatus.text = xstatus etc... objXML.save(server.MapPath("phonebooktest.xml")) Response.Redirect("phonebooktest.xml") %>
I've also tried this:

Code:
set objphonebook = objXML.documentElement
set objperson = objXML.createElement ("person")
set Attr = objXML.createAttribute("id")
set Text = objXML.createTextNode(xid)
Attr.appendChild(Text)
objperson.setAttributeNode(Attr)
objphonebook.appendChild objperson
but it doesn't seem to make aby difference. Can anyone help? Thanks.