Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XML deleteData method - how to use

Status
Not open for further replies.

XgrinderX

Programmer
Mar 27, 2001
225
US
Hello,

I am brand new to XML and I have a group of XML files that I am trying to read data from, change the data programmatically, and then update the data in the XML document. I have the entire process down except for the part where I actually update the data in the XML document. I cannot figure out how to creat an object that makes use of the deleteData, replaceData, or insertData methods.

I am writing this in VBScript (because that is what I know, I am an ASP programmer). Here is a snippet of the code:

nodeCount = 1
for each colEntry in getXML.getElementsByTagName("ColText")
if nodeCount = 1 then
newText = parseText(colEntry.text,75)
set objNode = colEntry
objNode.deleteData 0,5000
objNode.insertData 0,newText
set objNode = nothing
else
newText = parseText(colEntry.text,45)
set objNode = colEntry
objNode.deleteData 0,5000
objNode.insertData 0,newText
set objNode = nothing
end if
nodeCount = nodeCount + 1
next

NOTE: parseText is a function I wrote that is changing the text for me.

I get an error message saying "Object doesn't support this property or method: 'deleteData'", so apparently trying to set objNode = colEntry is not creating the CharacterData object correctly.

How can I do this? Thanks in advance.

-Greg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top