Detach

Description

Detaches a PBDOM_OBJECT from its parent.

Syntax

pbdom_object_name.Detach()

Argument

Description

pbdom_object_name

The name of the PBDOM_OBJECT


Return value

PBDOM_OBJECT.

Throws

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

Examples

This example detaches the root element of a PBDOM_DOCUMENT called pbdom_doc from its parent object -- that is, from the PBDOM_DOCUMENT itself. Then, it attempts to obtain the parent PBDOM_OBJECT and tests whether it is null using the IsValid method:

pbdom_obj = pbdom_doc.GetRootElement()
pbdom_obj.Detach()
pbdom_parent_obj = pbdom_obj.GetParentObject()
if (not IsValid(pbdom_parent_obj)) then
     MessageBox ("Invalid", "Root Element has no Parent")
end if

Usage

If the PBDOM_OBJECT has no parent, this method does nothing.