Description
Returns the parent PBDOM_OBJECT of the current PBDOM_OBJECT.
Syntax
pbdom_object_name.GetParentObject()
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.
EXCEPTION_MEMORY_ALLOCATION_FAILURE -- Insufficient memory was encountered while executing this method.
Examples
Using the GetRootElement method, the root element of a PBDOM_DOCUMENT called pbdom_doc is returned into a PBDOM_OBJECT called pbdom_obj. The GetParentObject method returns the parent of the root element, which is the PBDOM_DOCUMENT itself, and stores it in pbdom_parent_obj.
The GetObjectClassString method returns the class name of pbdom_parent_obj as a string that is displayed in a message box:
pbdom_document pbdom_doc pbdom_object pbdom_obj pbdom_object pbdom_parent_obj string strClassName // code omitted … pbdom_doc = pbdombuilder_new.BuildFromString (strXML) pbdom_obj = pbdom_doc.GetRootElement() pbdom_parent_obj = pbdom_obj.GetParentObject() strClassName = pbdom_parent_obj.GetObjectClassString() MessageBox ("Parent Class Name", strClassName)
Usage
If the PBDOM_OBJECT has no parent, null is returned.
See also