METHOD:  CharacterData::replaceData

CharacterData.replaceData(offset, count, data)

The replaceData method replaces the characters from the specified offset with the supplied string data.

In the following example, the 'albums.xml' file is loaded and the word 'Breakfast' in the 'title' element of the first 'album' is replaced with 'Dinner'.

   <Album ref="CD142" category="Folk">
      <title>Boil The Breakfast Early</title>
      <artist>The Chieftains</artist>
   <Album ref="CD720" category="Pop">
      <title>Come On Over</title>
      <artist>Shania Twain</artist>
   <Album ref="CD024" category="Country">
      <title>Red Dirt Girl</title>
      <artist>Emmylou Harris</artist>

Code (VBScript):
Set objXMLDoc = CreateObject("Microsoft.XMLDOM")
objXMLDoc.async = False

Set Elem = objXMLDoc.documentElement.firstChild.firstChild
Set Text = Elem.firstChild
Text.replaceData 9, 9, "Dinner"

Boil The Dinner Early

Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information