Description
The SetParentObject method sets the referenced PBDOM_OBJECT to be the parent of the current PBDOM_OBJECT and so sets the DOCTYPE represented by this PBDOM_DOCTYPE to be the DOCTYPE of the referenced PBDOM_DOCUMENT.
Syntax
pbdom_doctype_name.SetParentObject(pbdom_object pbdom_object_ref)
Argument |
Description |
---|---|
pbdom_doctype_name |
The name of a PBDOM_DOCTYPE object |
pbdom_object_ref |
A PBDOM_OBJECT to be set as the parent of the current PBDOM_DOCTYPE |
Return value
PBDOM_OBJECT.
Throws
EXCEPTION_PBDOM_OBJECT_ALREADY_HAS_PARENT -- If this PBDOM_DOCTYPE already has a parent.
EXCEPTION_MULTIPLE_DOCTYPE -- If the input PBDOM_OBJECT is a PBDOM_DOCUMENT object and already has a doctype.
EXCEPTION_INAPPROPRIATE_USE_OF_PBDOM_OBJECT -- If the input PBDOM_OBJECT is not a PBDOM_DOCUMENT.
EXCEPTION_PBDOM_OBJECT_INVALID_FOR_USE -- If the input PBDOM_OBJECT is not associated with a derived PBDOM_OBJECT.
Usage
This method sets the input PBDOM_OBJECT as the parent of the current PBDOM_OBJECT. The input PBDOM_OBJECT must be a PBDOM_DOCUMENT. If it is not, an exception is thrown.
In PBDOM, calling SetParentObject is equivalent to setting the input PBDOM_DOCUMENT as the owner document and parent node of the current PBDOM_DOCTYPE. This has the effect of setting the DOCTYPE in PBDOM_DOCTYPE as the DOCTYPE of the document.
A DOM DOCTYPE object can have no owner document, or it can have an owner document but no parent node. A DOCTYPE that has an owner document as well as a parent node is the actual DOCTYPE of the owner document.
This method is exactly the same as the SetDocument method.
See also