XMLAddNode

Top  Previous  Next

Prototype

 

intHandleNode:=XMLAddNode(intXMLHandle, intStartHandleNode, strNodeName)

 

Description

 

Adds a node as child of that indicated

 

Parameters

 

intXMLHandle:integer value corresponding to the XML handle

 

intStartHandleNode: node where add a child node (0 = root)

 

strNodeName: node name to create

 

Returned value

 

intHandleNode: integer value corresponding to the node added handle .

 

Notes

 

None

 

Example

 

XMLDocument:=XMLNewDocument('<d></d>');

 

XMLPage:=XMLAddNode(XMLDocument, 0,'p');

XMLSetNodeAttribute(XMLDocument,XMLPage,'n', IntToStr(0));

 

                 

//It takes OCR value

XMLWord:=XMLAddNode(XMLDocument, XMLPage,'w');

 

Value:='VALUE';                                                    

                                                                 

//It sets node and attributes value

XMLSetNodeText(XMLDocument,XMLWord,Value);

XMLSetNodeAttribute(XMLDocument,XMLWord,'ciclo_1','ATT1');  

 

//It takes xml document handle

FileName:='C:\Recogniform\xml\new.xml';

 

//It saves document

XMLSaveDocument(XMLDocument,FileName );

                                                               

//Deallocate memory

XMLCloseDocument(XMLDocument);