%XML_AddElementByCopy function


Function
The function adds an XML element which is a detailed copy of other XML element.
Declaration
INT %XML_AddElementByCopy(
   INT in node, 
   INT in nodeToCopy
 )
Parameters
nodeHandle to parent XML node.
nodeToCopyHandle to XML node that detailed copy will be created from.
Return value
Handle to the XML element added.
Description
The function adds an XML element to the defined parent XML node. Parent node can be a document or other element. This document represents the detailed copy of existing XML node, i.e. of node containing all its children.
Example
 INT _doc1
 INT _doc2
 
 INT _listOfElements
 INT _elementToCopy
 INT _parentElement
 INT _copyOfElement
 
 INT _freeDoc1
 INT _freeDoc2
 
 _doc1 := %XML_ExportD2ObjToDocument(objectName1\HBJ,"")
 _doc2 := %XML_ExportD2ObjToDocument(objectName2\HBJ,"")
 
 _listOfElements := %XML_GetElementsByTagName(_doc1, "HOBJ_REF")
 _elementToCopy := %XML_Item(_listOfElements,0)
 
 _listOfElements := %XML_GetElementsByTagName(_doc2,"REFERENCES")
 _parentElement := %XML_Item(_listOfElements,0>)
 
 _copyOfElement := %XML_AddElementByCopy(_parentElement, _elementToCopy) 
 
 _freeDocl := %XML_FreeDocument(_doc1) 
 _freeDoc2 := %XML_FreeDocument(_doc2)  
Napíšte komentár