SetContent – PB Docs 126

PBDOM_ELEMENT:

SetContent method

Description

Sets
the content of the PBDOM_ELEMENT object using an array
containing PBDOM_OBJECT objects legal for a PBDOM_ELEMENT
object. Any existing children of the PBDOM_ELEMENT object
are removed when the SetContent method is invoked.

If the input array reference is null, all
contents of the PBDOM_ELEMENT object are removed. If the
array contains illegal objects, an exception is thrown, and nothing
is altered.

Syntax

Argument

Description

pbdom_element_name

The name of a PBDOM_ELEMENT
object

pbdom_object_array

An array of PBDOM_OBJECTS to
form the contents the PBDOM_ELEMENT object

Return Values

PBDOM_OBJECT. The PBDOM_ELEMENT object modified
and returned as a PBDOM_OBJECT.

Throws

EXCEPTION_USE_OF_UNNAMED_PBDOM_OBJECT – If
an input PBDOM_OBJECT array item has not been given a user-defined
name.

EXCEPTION_PBDOM_OBJECT_INVALID_FOR_USE – If
an input PBDOM_OBJECT array item is not associated with
a derived PBDOM_OBJECT.

EXCEPTION_PBDOM_OBJECT_ALREADY_HAS_PARENT – If
an input PBDOM_OBJECT array item already has a parent PBDOM_OBJECT.

EXCEPTION_INAPPROPRIATE_USE_OF_PBDOM_OBJECT – If
an inappropriate PBDOM_OBJECT array item is found. This
happens if the PBDOM_OBJECT array item is not allowed to
be added as a child of a PBDOM_ELEMENT object (for example,
a PDBOM_DOCUMENT).

EXCEPTION_HIERARCHY_ERROR – If
one of the PBDOM_OBJECT array items, if set as part of
the contents of this PBDOM_ELEMENT object, will cause the
current PBDOM_ELEMENT object to be no longer well formed.

Examples

The SetContent method is invoked
on the following XML fragment:

The SetContent method is invoked from the
following PowerScript code:

The entry_1 PBDOM_ELEMENT
object contains the following:

The entry_2 PBDOM_ELEMENT
object contains the following:

The SetContent method returns the following:

Usage

Only the following PBDOM_OBJECT types can be validly
added to a PBDOM_ELEMENT object:

  • PBDOM_ELEMENT

  • PBDOM_CDATA

  • PBDOM_COMMENT

  • PBDOM_ENTITYREFERENCE

  • PBDOM_PROCESSINGINSTRUCTION

  • PBDOM_TEXT

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