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
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