Initializing help system before first use

copynode

Purpose
Copy a node .
Synopsis
function copynode(src:xmldoc, s:integer, dst:xmldoc, d:integer, where:integer):integer
Arguments
src 
Document of node to be copied
Number of the node to copy
dst 
Destination document
Node number where to attach the new node in the destination document
where 
How to attach the copy of the source node to the node d:
XML_FIRST 
as the first element of the list where node d is located
XML_LAST 
as the last element of the list where node d is located
XML_NEXT 
after node d
XML_FIRSTCHILD 
as the first child of node d (node d must be an element)
XML_LASTCHILD 
as the last child of node d (node d must be an element)
Return value
Number of the newly created node within the destination document.
Example
The following code extract shows how to move (copy node, then delete original) and edit a node with all its descendants
  declarations
    DB: xmldoc
    APAC, NewPers, Pers: integer
  end-declarations

 ! Retrieve destination region node
  APAC:= getnode(DB, "personnelList/region[@id='APAC']")
 ! Retrieve employee record (node) for 'Lisa'
  Pers:=
    getnode(DB, "personnelList/region/employee/name[string()='Lisa']/..")
 ! Employee Lisa moves to Delhi: copy node & delete in original location
  NewPers:= copynode(DB, Pers, DB, APAC, XML_LASTCHILD)
  delnode(DB, Pers)
 ! Update the 'address' information
  setvalue(DB, getnode(DB, NewPers, "address"), "Delhi") 
Further information
This routine copies the node as well as all of its descendants if it is an element node. Source and destination documents may be the same.
Related topics
Module

© 2001-2025 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.