Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

GetOwnerDocumentObject – PB Docs 126 – PowerBuilder Library

GetOwnerDocumentObject – PB Docs 126

PBDOM_CHARACTERDATA:

GetOwnerDocumentObject method

Description

The GetOwnerDocumentObject method
returns the owning PBDOM_DOCUMENT of the current PBDOM_CHARACTERDATA.

Syntax

Argument

Description

pbdom_chardata_name

The name of a PBDOM_CHARACTERDATA
object

Return Values

PBDOM_OBJECT.

Throws

EXCEPTION_PBDOM_OBJECT_INVALID_FOR_USE – If
this PBDOM_CHARACTERDATA is not associated with a derived PBDOM_CHARACTERDATA
class.

Examples

This example creates a PBDOM_DOCUMENT based
on the following DOM tree:

The PowerScript code obtains the root element, uses it to
obtain the child element, and then obtains an array of the child
element’s own children. This array has a single item, the
PBDOM_TEXT object with the text Data. The array can be
cast to a PBDOM_CHARACTERDATA object because it does not
contain any objects that are not derived from PBDOM_CHARACTERDATA,

The call to GetOwnerDocumentObject returns
a PBDOM_OBJECT, which is stored in a PBDOM_DOCUMENT
called pbdom_owner_doc. The
call to Equals tests whether the owner document
of the “Data” PBDOM_TEXT and the main
document, referenced using pbdom_doc,
refer to the same document.

This example creates a PBDOM_DOCUMENT based
on the same DOM tree as example 1. It creates a PBDOM_TEXT,
stores it in the PBDOM_CHARACTERDATA variable pbdom_chardata,
and assigns it some text. Objects created in this way are standalone
objects—they have no owner document or parent. Calling GetOwnerDocumentObject on pbdom_chardata returns null.

The code then adds pbdom_chardata as
a child to the data element. This implicitly imports pbdom_chardata into
the original document. pbdom_chardata now
has an owner document and a parent (the data element). Calling GetOwnerDocumentObject on pbdom_chardata returns
the original document. When the returned PBDOM_DOCUMENT
has been assigned into pbdom_owner_doc,
a call to Equals to compare pbdom_doc with pbdom_owner_doc returns
true:

Usage

If there is no owning PBDOM_DOCUMENT, null is
returned.

See Also


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