HasChildren

Description

Determines whether the PBDOM_OBJECT has any child objects.

Syntax

pbdom_object_name.HasChildren()

Argument

Description

pbdom_object_name

The name of the PBDOM_OBJECT


Return value

Boolean.

Returns true if the current PBDOM_OBJECT has at least one child PBDOM_OBJECT, and false if it has none.

Throws

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

Examples

In the following example, a PBDOM_DOCUMENT is created from a simple XML string. The root element abc has a child text node that encapsulates the text "abc data". Calling HasChildren on the root element returns true. The message box displays Has Children. If the method returns false, the message box displays Has No Children

PBDOM_Builder pbdombuilder_new
pbdom_document pbdom_doc
pbdom_object pbdom_root_element
string strXML = "<abc>abc data</abc>"

pbdombuilder_new = Create PBDOM_Builder
pbdom_doc = pbdombuilder_new.BuildFromString (strXML)
pbdom_root_element = pbdom_doc.GetRootElement()
if (pbdom_root_element.HasChildren()) then
     MessageBox ("pbdom_root_element", "Has Children")
else
     MessageBox ("pbdom_root_element", "Has No Children")
end if
Destroy pbdombuilder_new

Usage

True is returned if the PBDOM_OBJECT has at least one child, and false if there are no children.