Description
The PBDOM_CHARACTERDATA class represents character-based content (not markup) within an XML document. It extends the PBDOM_OBJECT class with a set of methods specifically intended for manipulating character data in the DOM.
The PBDOM_CHARACTERDATA class is the parent class of three other PBDOM classes:
-
PBDOM_TEXT
-
PBDOM_CDATA
-
PBDOM_COMMENT
The PBDOM_CHARACTERDATA class, like its parent class PBDOM_OBJECT, is a "virtual" class (similar to a virtual C++ class) in that it is not expected to be directly instantiated and used.
For example, in the following code, the attempt to set the text of pbdom_chrdata raises an exception:
PBDOM_CHARACTERDATA pbdom_chrdata pbdom_chrdata = CREATE PBDOM_CHARACTERDATA pbdom_chrdata.SetText ("character string")//error
In this example, the attempt to set the text of pbdom_chrdata succeeds because pbdom_chrdata is declared as a PBDOM_CHARACTERDATA but instantiated as a PBDOM_TEXT:
PBDOM_CHARACTERDATA pbdom_chrdata pbdom_chrdata = CREATE PBDOM_TEXT pbdom_chrdata.SetText ("character string")//success
Methods
Some of the inherited methods from PBDOM_OBJECT serve no meaningful objective and only default or trivial functionalities result. These are described in the following table:
Method |
Always returns |
---|---|
AddContent |
current PBDOM_CHARACTERDATA |
GetContent |
false |
InsertContent |
current PBDOM_CHARACTERDATA |
RemoveContent |
false |
SetContent |
current PBDOM_CHARACTERDATA |
SetName |
false |
PBDOM_CHARACTERDATA has the following non-trivial methods: