Manipulating the node-tree hierarchy – PB Docs 125

Manipulating the node-tree hierarchy

You can restructure an XML node tree by rearranging its nodes.
One means of manipulating nodes involves detaching a child node
from its parent node. This can be accomplished with the Detach method,
as in the following example.

The root element of a PBDOM_DOCUMENT object named pbdom_doc is obtained
using the GetRootElement method:

The root element is detached from the PBDOM_DOCUMENT
object, which is the parent node of the root element:

PBDOM provides the SetParentObject method
to make an object a child of another object.

Checking for parent node

The GetParentObject method can be used
to determine whether an element has a parent object, as in the following
example:

If the object on which GetParentObject is
called has no parent object, the function returns NULL.

PBDOM provides similar methods that return information about
an element’s place in an XML node tree. These methods include HasChildren,
which returns a boolean indicating whether an object has child objects,
and IsAncestorObjectOf, which indicates whether
an object is the ancestor of another object.


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