GetText

Description

Calling the GetText method allows you to obtain text data that is contained within the current PBDOM_CHARACTERDATA.

Syntax

pbdom_chardata_name.GetText()

Argument

Description

pbdom_chardata_name

The name of a PBDOM_CHARACTERDATA object


Return value

String.

The text of the current PBDOM_CHARACTERDATA-derived object.

Throws

Throws EXCEPTION_PBDOM_OBJECT_INVALID_FOR_USE -- If this PBDOM_CHARACTERDATA is not a reference to an object derived from PBDOM_CHARACTERDATA.

Usage

The following table lists the return values based on the type of DOM Object contained within PBDOM_CHARACTERDATA.

DOM Object

Return Value

PBDOM_TEXT

The text data contained within the PBDOM_TEXT object itself.

For example, suppose you have the following element:

<abc>MY TEXT</abc>

If you have a PBDOM_TEXT object to represent the TEXT NODE "MY TEXT", then calling GetText on the PBDOM_TEXT returns the string MY TEXT.

PBDOM_CDATA

The string data that is contained within the CDATA section itself. For example, suppose you have the following CDATA:

<![CDATA[ They're saying "x < y" & that "z 
> y" so I guess that means that z > x ]]>

If there is a PBDOM_CDATA to represent the above CDATA section, then calling GetText returns the string:

They're saying "x < y" & that "z > y" so I 
guess that means that z > x

PBDOM_COMMENT

The comment itself. For example, suppose you have the following comment:

<!--This is a comment. -->

Calling GetText on the comment returns the string:

This is a comment.

See also

GetTextNormalize

GetTextTrim

SetText