simple XML APPENDING problem

admin

Administrator
Staff member
my script just aims to append a new child node (that has been read in froman html form) to an existing 3 tier (incl. root element) xml doc...i geta 500 error ...comment in the code below indicates where i suspect (but can'tfigure out why) problem exists...any help would be appreciated...TIA!<%Dim objXMLDocDim objParentNodeDim objNewEntryDim objNewParentNodeDim objNewDateTextDim objNewBlurbTextDim objNewLink1TextDim objNewLink2TextDim objNewDateElementDim objNewBlurbElementDim objNewLink1ElementDim objNewLink2ElementDim newDate, newBlog, newLink1, newLink2Set objXMLDoc = CreateObject("Microsoft.XMLDOM")objXMLDoc.async = FalseobjXMLDoc.load("blurb.xml")newDate = Request.Form("date")newBlog = Request.Form("blurb")newLink1 = Request.Form("link1")newLink2 = Request.Form("link2")Set objNewDateElement = objXMLDoc.createElement("date")Set objNewDateText = objXMLDoc.createTextNode(newDate)objNewDateElement.appendChild(objNewDateText)Set objNewBlurbElement = objXMLDoc.createElement("blurb")Set objNewBlurbText = objXMLDoc.createTextNode(newBlurb)objNewBlurbElement.appendChild(objNewBlurbText)Set objNewLink1Element = objXMLDoc.createElement("link1")Set objNewLink1Text = objXMLDoc.createTextNode(newLink1)objNewLink1Element.appendChild(objNewLink1Text)Set objNewLink2Element = objXMLDoc.createElement("link2")Set objNewLink2Text = objXMLDoc.createTextNode(newLink2)objNewLink2Element.appendChild(objNewLink2Text)Set objNewEntry = objXMLDoc.createElement("entry")objNewEntry.appendChild(objNewDateElement)objNewEntry.appendChild(objNewBlurbElement)objNewEntry.appendChild(objNewLink1Element)objNewEntry.appendChild(objNewLink2Element)Set objParentNode = objXMLDoc.documentElement'THIS IS LINE WHERE I THINK PROBLEM ISobjParentNode.appendChild(objNewEntry)'code goes on to save the xml doc from here to end
 
Back
Top