Description
Returns the owner PBDOM_ELEMENT of this PBDOM_ATTRIBUTE. If there is no owner element, null is returned.
Syntax
pbdom_attribute_name.GetOwnerElementObject( )
Return value
PBDOM_ELEMENT. The owner PBDOM_ELEMENT of this PBDOM_ATTRIBUTE or null if this PBDOM_ATTRIBUTE has no owner element.
Throws
EXCEPTION_PBDOM_OBJECT_INVALID_FOR_USE -- This PBDOM_ATTRIBUTE object's internal implementation is null. The occurrence of this exception is rare but can take place if severe memory corruption occurs.
Examples
This example creates a PBDOM_DOCUMENT from a string strXML in which the abc root element contains one attribute, My_Attr. The code gets this attribute, calls GetOwnerElementObject on it to obtain the owner element, then calls GetName to return the string abc. Finally, it sets My_Attr as an attribute of the child element Data:
PBDOM_BUILDER pbdombuilder_new PBDOM_DOCUMENT pbdom_doc PBDOM_ATTRIBUTE pbdom_attr PBDOM_ELEMENT pbdom_elem string strXML = "<abc My_Attr=~"My Attribute Value~"><data>Data</data></abc>" TRY pbdombuilder_new = Create PBDOM_Builder pbdom_doc = pbdombuilder_new.BuildFromString (strXML) // Get the attribute pbdom_attr = pbdom_doc.GetRootElement(). & GetAttribute("My_Attr") MessageBox ("pbdom_attr Owner Element Name", & pbdom_attr.GetOwnerElementObject().GetName()) pbdom_attr.Detach() pbdom_elem = pbdom_doc.GetRootElement(). & GetChildElement("data") pbdom_elem.SetAttribute (pbdom_attr) MessageBox ("pbdom_attr Owner Element Name", & pbdom_attr.GetOwnerElementObject().GetName()) Destroy pbdombuilder_new Destroy pbdom_doc CATCH (PBDOM_Exception except) MessageBox ("Exception Occurred", except.Text) END TRY
See also