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

SetOwnerElementObject – PB Docs 150 – PowerBuilder Library

SetOwnerElementObject – PB Docs 150

PBDOM_ATTRIBUTE:

SetOwnerElementObject method

Description

Sets
the input PBDOM_ELEMENT as the owner of the current PBDOM_ATTRIBUTE.

Syntax

Argument

Description

pbdom_attribute_name

The name of the PBDOM_ATTRIBUTE

pbdom_element_ref

The PBDOM_ELEMENT to be set
as the owner of this current PBDOM_ATTRIBUTE

Return Values

PBDOM_ATTRIBUTE. This PBDOM_ATTRIBUTE itself
modified and returned.

Throws

EXCEPTION_INVALID_ARGUMENT – The
input PBDOM_ELEMENT is invalid. This can happen if it has
not been initialized properly or is a null object reference.

EXCEPTION_PBDOM_OBJECT_INVALID_FOR_USE – The
internal implementation of the PBDOM_ATTRIBUTE object or
the input PBDOM_ELEMENT object is null.
The occurrence of this exception is rare but can take place if severe
memory corruption occurs.

EXCEPTION_PBDOM_OBJECT_ALREADY_HAS_OWNER – This PBDOM_ATTRIBUTE
already has an owner Element.

EXCEPTION_USE_OF_UNNAMED_PBDOM_OBJECT – The
input PBDOM_ELEMENT has not been named.

EXCEPTION_INVALID_NAME – The
input PBDOM_ELEMENT already contains an attribute that
has the same name and that belongs to the same namespace as this
current PBDOM_ATTRIBUTE.

Examples

This example moves the positions of two PBDOM_ATTRIBUTE
objects from one element to another.

In the string strXML from which a PBDOM_DOCUMENT
is created, the abc root element contains a
namespace declaration and two attributes. My_Attr belongs
to no namespace, and pre:My_Attr_NS belongs
to the http://www.pre.com namespace. The example
obtains handles for the two attributes and the data element,
then detaches both attributes from abc and
sets data as their new owner:

When the document is serialized, the XML looks like this:

Usage

According to the “Namespace in XML” specifications,
an element cannot contain two attributes with the same local name
and namespace URI. This is true even if the prefixes of the two
attributes are different. An exception is thrown if this rule is
violated when SetOwnerElementObject is invoked.

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