Table Of Contents

Previous topic


Next topic



Inherited by: QDomComment, QDomText, QDomCDATASection



Detailed Description

The PySide.QtXml.QDomCharacterData class represents a generic string in the DOM.

Character data as used in XML specifies a generic data string. More specialized versions of this class are PySide.QtXml.QDomText , PySide.QtXml.QDomComment and PySide.QtXml.QDomCDATASection .

The data string is set with PySide.QtXml.QDomCharacterData.setData() and retrieved with . You can retrieve a portion of the data string using PySide.QtXml.QDomCharacterData.substringData() . Extra data can be appended with PySide.QtXml.QDomCharacterData.appendData() , or inserted with PySide.QtXml.QDomCharacterData.insertData() . Portions of the data string can be deleted with PySide.QtXml.QDomCharacterData.deleteData() or replaced with PySide.QtXml.QDomCharacterData.replaceData() . The length of the data string is returned by PySide.QtXml.QDomCharacterData.length() .

The node type of the node containing this character data is returned by PySide.QtXml.QDomCharacterData.nodeType() .

class PySide.QtXml.QDomCharacterData
class PySide.QtXml.QDomCharacterData(x)

Constructs an empty character data object.

Constructs a copy of x .

The data of the copy is shared (shallow copy): modifying one node will also change the other. If you want to make a deep copy, use PySide.QtXml.QDomNode.cloneNode() .

Parameters:arg – unicode

Appends the string arg to the stored string.
Return type:unicode

Returns the string stored in this object.

If the node is a null node , it will return an empty string.

PySide.QtXml.QDomCharacterData.deleteData(offset, count)
  • offset – long
  • count – long

Deletes a substring of length count from position offset .

PySide.QtXml.QDomCharacterData.insertData(offset, arg)
  • offset – long
  • arg – unicode

Inserts the string arg into the stored string at position offset .

Return type:PySide.QtCore.uint

Returns the length of the stored string.

PySide.QtXml.QDomCharacterData.replaceData(offset, count, arg)
  • offset – long
  • count – long
  • arg – unicode

Replaces the substring of length count starting at position offset with the string arg .

Parameters:arg__1 – unicode

Sets this object’s string to v .

PySide.QtXml.QDomCharacterData.substringData(offset, count)
  • offset – long
  • count – long
Return type:


Returns the substring of length count from position offset .