Show: Delphi C++
Display Preferences

Xml.XMLDoc.TNodeListNotification

From RAD Studio API Documentation
Jump to: navigation, search

C++

typedef void __fastcall (__closure *TNodeListNotification)(TNodeListOperation Operation, Xml::Xmlintf::_di_IXMLNode &Node, const System::OleVariant &IndexOrName, bool BeforeOperation);

Properties

Type Visibility Source Unit Parent
typedef public Xml.XMLDoc.hpp Xml.XMLDoc Xml.XMLDoc

Description

TNodeListNotification is the type of the callback the TXMLNodeList calls when it adds, deletes, or creates XML nodes.

TNodeListNotification is the type for the callback supplied to TXMLNodeList in its constructor. TXMLNodeList calls this procedure before and after it adds or deletes nodes in the list and when it needs to create a new node.

Operation indicates what change is about to occur or has just occurred.

Node specifies the node that is the focus of that change. Its use depends on the operation, as indicated in the following table:



Operation Node

nlInsert

The node that is about to be added to the list or that has just been added.

nlRemove

The node that is about to be removed from the list or that has just been removed.

nlCreateNode

The newly-created node. This should be created by the callback and returned as the Node parameter.

ntElement

The tag name.

ntAttribute

The name of the attribute.

ntText

The value of the node.

ntCData

The value of the CDATA section.

ntEntityRef

The name of the referenced entity.

ntProcessingInstr

The target of the processing instruction.

ntComment

The value (text) of the comment.

ntDocFragment

Not used.



IndexOrName is used only when Operation is nlCreateNode. It is the value assigned to the Nodes property using the index of a node that does not yet exist. The interpretation of IndexOrName depends on the type of node that the callback creates, as indicated in the following table:



NodeType IndexOrName

ntElement

The tag name.

ntAttribute

The name of the attribute.

ntText

The value of the node.

ntCData

The value of the CDATA section.

ntEntityRef

The name of the referenced entity.

ntProcessingInstr

The target of the processing instruction.

ntComment

The value (text) of the comment.

ntDocFragment

Not used.



BeforeOperation indicates whether the callback occurs before the indicated operation or after. When nodes are inserted and removed, the callback is called first with BeforeOperation set to true, then the operation occurs, and then a second callback is made with BeforeOperation set to false. When nodes must be created, only one call is made, with BeforeOperation set to true.

See Also

Personal tools
In Other Languages
Previous Versions
Assistance