XML

XMLDOMCharacterData Object

The XMLDOMCharacterData object makes it easier to work with the text content in an XML document. The IXMLDOMCharacterData interface implemented by the XMLDOMCharacterData object also inherits the IXMLDOMNode interface, so it includes all the properties and methods of the IXMLDOMNode interface. Moreover, it extends the IXMLDOMNode interface with the following properties and methods:

Extended IXMLDOMCharacterData Properties

Name Description
data Contains the node's data. The actual data will depend on the type of node.
length Returns the number of characters in the data string.

Extended IXMLDOMCharacterData Methods

Name Description
appendData (text) Appends the text argument onto the existing data string
deleteData (charOffset, numChars) Deletes numChars characters off the data string starting at charOffset
insertData (charOffset, text) Inserts the supplied text into the data string at the charOffset
replaceData (charOffset, numChars, text) Replaces numChars characters with the supplied text starting at charOffset
substringData (charOffset, numChars) Returns the numChars characters as a string, starting at charOffset, in the data string

XMLDOMText Object

The XMLDOMText object represents the text node of an element or an attribute. You can use the XMLDOMText object to build text nodes and append them into an XML document. The IXMLDOMText interface implemented by the XMLDOMText object inherits the IXMLDOMCharacterData interface and extends it with the following method:

Extended IXMLDOMText Method

Name Description
splitText (charOffset) Splits the node into two nodes at the specified character offset and then inserts the new node into the XML document immediately following the node

XMLDOMCDATASection Object

An XMLDOMCDATASection object is used for sections of text that are not to be interpreted by the processor as markup. The XMLDOMCDATASection object implements the IXMLDOMCDATASection interface. This interface inherits the IXMLDOMText interface and has the same methods and properties as the IXMLDOMText interface.

XMLDOMComment Object

The XMLDOMComment object contains comments that are in the XML document. The IXMLDOMComment interface implemented by this object inherits the IXMLDOMCharacterData interface and also possesses the same methods and properties as IXMLDOMCharacterData. The IXMLDOMComment interface does not extend the IXMLDOMCharacterData interface.

by BrainBellupdated
Advertisement: