GetText – PB Docs 126

PBDOM_OBJECT:

GetText method

Description

Obtains
the text data that is contained within the current PBDOM_OBJECT.

Syntax

Argument

Description

pbdom_object_name

The name of the PBDOM_ OBJECT

Return Values

String.

The following table lists the return values, based on the
type of DOM Object contained within a PBDOM_OBJECT:

DOM Object Type

Return Value

PBDOM_ELEMENT

The concatenation of the text values
of all the TEXT nodes contained within the PBDOM_ELEMENT.

If the PBDOM_ELEMENT definition is <abc>Root Element
Data<data>ABC Data </data>
now with extra info </abc>
,
then GetText returns "Root
Element Data now with extra info "
.

note.png Extra Spaces

There are extra spaces between the word “Data” and “now” and
again after the word “info”. They are there because
they originally exist in the text.

If the PBDOM_ELEMENT definition is: <abc>Root Element
Data</abc>
, then GetText returns "Root Element
Data"
.

PBDOM_ATTRIBUTE

The text data contained within the PBDOM_ATTRIBUTE
object.

If the element with an attribute is <abc ATTRIBUTE_1="My
Attribute">
, then GetText returns “My
Attribute”
.

PBDOM_TEXT

The text data contained within the PBDOM_TEXT object
itself.For example, suppose there is the following element:

If there is 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 there is the following CDATA:

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

PBDOM_COMMENT

The string data that is contained within
the COMMENT itself. For example, suppose there is the following COMMENT:

If there is a PBDOM_COMMENT
to represent the above COMMENT, then calling GetText on
it returns the following string:

Throws

EXCEPTION_PBDOM_OBJECT_INVALID_FOR_USE – This PBDOM_OBJECT
object is not associated with a derived PBDOM_OBJECT class
object.

EXCEPTION_MEMORY_ALLOCATION_FAILURE – Insufficient
memory was encountered while executing this method.

Usage

This method returns meaningful data only if the PBDOM_OBJECT
is of a type that can contain text nodes, CDATA sections, or basic
text. These include:

  • PBDOM_ELEMENT

  • PBDOM_ATTRIBUTE

  • PBDOM_TEXT

  • PBDOM_CDATA

  • PBDOM_COMMENT

The PBDOM_TEXT, PBDOM_CDATA, and PBDOM_COMMENT
objects are special cases that cause the GetText method
to return the text data that is intrinsically contained within the
objects. A PBDOM_TEXT object is basically a DOM text node
and therefore does not hold any child text nodes. A PBDOM_CDATA
object represents a DOM CDATA object, and therefore does not hold
any child DOM nodes. The same rule applies to a PBDOM_COMMENT
object.

See Also


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x