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

SetParentObject – PB Docs 2021 – PowerBuilder Library

SetParentObject – PB Docs 2021

SetParentObject

Description

The SetParentObject method sets the referenced PBDOM_OBJECT to be
the parent of the current PBDOM_CHARACTERDATA.

Syntax

Argument

Description

pbdom_chardata_name

The name of a PBDOM_CHARACTERDATA

pbdom_object_ref

A PBDOM_OBJECT to be set as the parent of this
PBDOM_CHARACTERDATA object

Return value

PBDOM_OBJECT.

Throws

EXCEPTION_PBDOM_OBJECT_INVALID_FOR_USE — If this
PBDOM_CHARACTERDATA is not a reference to an object derived from
PBDOM_CHARACTERDATA. This exception also occurs if the input
PBDOM_OBJECT is not a reference to an object derived from
PBDOM_OBJECT.

EXCEPTION_PBDOM_OBJECT_ALREADY_HAS_PARENT — If the current
PBDOM_CHARACTERDATA already has a parent.

EXCEPTION_INAPPROPRIATE_USE_OF_PBDOM_OBJECT — If the input
PBDOM_OBJECT is of a class that does not have a proper parent-child
relationship with the class of this PBDOM_CHARACTERDATA.

EXCEPTION_USE_OF_UNNAMED_PBDOM_OBJECT — If the input
PBDOM_OBJECT requires a user-defined name, and it has not been
named.

Examples

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

The code creates three separate types of PBDOM_CHARACTERDATA
objects and stores them in the pbdom_chardata array. It then obtains the
root element, uses it to obtain the data child element, and then uses
that to obtain the first child element, which it sets as the parent of
the first item in the pbdom_chardata array.

The text of the array item is set to Comment. You can set the
string content of any PBDOM_CHARACTERDATA object after you have set it
as the child of a parent.

The same process is repeated for the text and CDATA
objects:

When the PBDOM_DOCUMENT is saved to a file, the output DOM tree
looks like this:

Usage

The PBDOM_OBJECT that you set to be the parent of the current
PBDOM_CHARACTERDATA must have a legal parent-child relationship. If it
does not, an exception is thrown.

See also

GetParentObject


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