HasChildren – PB Docs 126

PBDOM_ATTRIBUTE:

HasChildren method

Description

Determines
whether this PBDOM_ATTRIBUTE object contains any child PBDOM_OBJECTs.

Syntax

Argument

Description

pbdom_attribute_name

The name of the PBDOM_ATTRIBUTE

Return Values

Boolean. Returns true if
this PBDOM_ATTRIBUTE contains child objects and false otherwise.

Throws

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

Examples

This example creates a PBDOM_DOCUMENT from
a string. The XML document in the string already contains a root
element named root that contains an attribute attr that
contains an empty string. It then represents attr as
a PBDOM_ATTRIBUTE object and calls its HasChildren method,
which returns true because a PBDOM_ATTRIBUTE
always contains at least one child object. After a call to GetContent,
the message box shows that attr contains only one
child, a PBDOM_TEXT that represents the empty string:

Usage

This method checks to see if this PBDOM_ATTRIBUTE
object contains any child PBDOM_OBJECTs and returns true if
it does. Note that according to the W3C DOM specification, a DOM
Attribute Node can contain only Text and Entity Reference Nodes,
therefore a PBDOM_ATTRIBUTE object can contain only PBDOM_TEXT
and PBDOM_ENTITYREFERENCE objects.Even if a PBDOM_ATTRIBUTE
object’s text value is an empty string, it always contains
at least one PBDOM_TEXT object that represents the empty string.


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x