Description
The PBDOM_CDATA class represents an XML DOM CDATA section. The PBDOM_CDATA class is derived from PBDOM_TEXT, which inherits from the PBDOM_CHARACTERDATA class.
A PBDOM_CDATA object is used to hold text that contains characters that are prohibited in text objects, such as "<" and "&", without using entity references. For example, consider the following PBDOM_CDATA object:
<some_text> <![CDATA[ (x < y) & (y < z) => x < z ]]> </some_text>
A PBDOM_TEXT object with the same text content must be written like this:
<some_text> (x < y) & (y < z) => x < z </some_text>
However, although the PBDOM_CDATA class is derived from PBDOM_TEXT, a PBDOM_CDATA object cannot always be inserted in the same context as a PBDOM_TEXT. For example, a PBDOM_TEXT object can be added as a child of a PBDOM_ATTRIBUTE, but a PBDOM_CDATA object cannot.
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_CDATA |
GetContent |
false |
GetName |
a string "#cdata" |
HasChildren |
false |
InsertContent |
current PBDOM_CDATA |
IsAncestorObjectOf |
false |
RemoveContent |
false |
SetContent |
current PBDOM_CDATA |
SetName |
false |
PBDOM_CDATA has the following non-trivial methods: