PBDOM_COMMENT

Description

The PBDOM_COMMENT class represents a DOM Comment Node within an XML document. The PBDOM_COMMENT class is derived from the PBDOM_CHARACTERDATA class and is intended to extend the PBDOM_CHARACTERDATA class with a set of methods intended specifically for manipulating DOM comment nodes.

You can use comments to annotate an XML document with user-readable information.

In PBDOM, when a document is parsed, any comments found within the document persist as part of the resultant DOM tree in memory. A PBDOM_COMMENT created at runtime also becomes part of the DOM tree. However, an XML comment does not usually form part of the content model of a document.

The presence or absence of comments has no bearing on a document's validity. There is no requirement that comments must be predeclared in a DTD.

Methods

Some of the inherited methods from PBDOM_OBJECT serve no meaningful objective, and only default or trivial functionalities result. These are described in the following table:

Method

Always returns

AddContent

current PBDOM_COMMENT

GetContent

false

GetName

a string "#comment"

HasChildren

false

InsertContent

current PBDOM_COMMENT

IsAncestorObjectOf

false

RemoveContent

false

SetContent

current PBDOM_COMMENT

SetName

false


PBDOM_COMMENT has the following non-trivial methods:

Append

Clone

Detach

Equals

GetObjectClass

GetObjectClassString

GetOwnerDocumentObject

GetParentObject

GetText

GetTextNormalize

GetTextTrim

SetParentObject

SetText