This method replaces the characters from the specified offset with the supplied string data.
XML:
<Albums>
<Album ref="CD142" category="Folk">
<title>Boil The Breakfast Early</title>
<artist>The Chieftains</artist>
</Album>
<Album ref="CD720" category="Pop">
<title>Come On Over</title>
<artist>Shania Twain</artist>
</Album>
<Album ref="CD024" category="Country">
<title>Red Dirt Girl</title>
<artist>Emmylou Harris</artist>
</Album>
</Albums>
VBScript:
Set objXMLDoc = CreateObject("Microsoft.XMLDOM")
objXMLDoc.async = False
objXMLDoc.load("albums.xml")
Set Elem = objXMLDoc.documentElement.firstChild.firstChild
Set Text = Elem.firstChild
Text.replaceData 9, 9, "Dinner"
document.write(Text.Data)
Boil The Dinner Early
In this example, the 'albums.xml' file is loaded and the word 'Breakfast' in the 'title' element of the first 'album' is replaced with 'Dinner'.