RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
XMLDoc.TNodeListNotification Type

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

Pascal
TNodeListNotification = procedure (Operation: TNodeListOperation; var Node: IXMLNode; const IndexOrName: OleVariant; BeforeOperation: Boolean) of object;
C++
(Operation: TNodeListOperation; var Node: IXMLNode; const IndexOrName: OleVariant; BeforeOperation: Boolean) ( TNodeListNotification)();

XMLDoc

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. It's 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. 

 

TXMLNodeList 

TXMLNode 

TXMLNode 

IXMLNodeList

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!