DeepCopy (XmlNode function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
Line 1: Line 1:
<span style="font-size:120%; color:black"><b>Copy an XmlDoc or XmlNode</b></span>
<span style="font-size:120%; color:black"><b>Copy an XmlDoc or XmlNode</b></span>
[[Category:XmlDoc methods|DeepCopy function]]
[[Category:XmlNode methods|DeepCopy function]]
[[Category:XmlNode methods|DeepCopy function]]
[[Category:XmlDoc API methods]]
[[Category:XmlDoc API methods]]
<!--DPL?? Category:XmlDoc methods|DeepCopy function: Copy an XmlDoc or XmlNode-->
<!--DPL?? Category:XmlNode methods|DeepCopy function: Copy an XmlDoc or XmlNode-->
<!--DPL?? Category:XmlDoc API methods|DeepCopy (XmlDoc/XmlNode function): Copy an XmlDoc or XmlNode-->
<!--DPL?? Category:System methods|DeepCopy (XmlDoc/XmlNode function): Copy an XmlDoc or XmlNode-->
<p>
<p>
DeepCopy is a member of the [[XmlDoc class|XmlDoc]] and [[XmlNode class|XmlNode]] classes.
This method returns an exact copy of an XmlNode method object.
</p>


This method returns an exact copy of an XmlDoc or XmlNode method object.
Since an XmlNode cannot exist without its underlying XmlDoc, an XmlNode is deep copyable only, and no Copy method exists for an XmlNode.
 
For XmlDocs, DeepCopy is identical to the XmlDoc [[Copy (XmlDoc function)|Copy]] method.
Since an XmlNode cannot exist without its underlying XmlDoc, however,
an XmlNode is deep copyable only, and no Copy method exists for an XmlNode.


For more information about copyability, see [[Copying objects]].
For more information about copyability, see [[Copying objects]].
Line 35: Line 25:
<li>The method object (''%xmlobj'') may be null.
<li>The method object (''%xmlobj'') may be null.
The output of a copy of a null object is a null object.
The output of a copy of a null object is a null object.
<li>For an XmlNode, a DeepCopy copies the underlying XmlDoc
<li>A <var>deepCopy</var> copies the underlying <var>xmlDoc</var> and sets the output <var>xmlNode</var> to the node in the new <var>xmlDoc</var> that corresponds to the input <var>xmlNode</var>.
and sets the output XmlNode to the node in the new XmlDoc that
corresponds to the input XmlNode.
The [[AddSubtree (XmlDoc/XmlNode function)|AddSubtree]] method
The [[AddSubtree (XmlDoc/XmlNode function)|AddSubtree]] method
performs a different kind of copy:
performs a different kind of copy:
it copies a specified XmlNode and appends it to the method object.
it copies a specified XmlNode and appends it to the method object.
</ul>
</ul>

Revision as of 04:59, 23 January 2011

Copy an XmlDoc or XmlNode

This method returns an exact copy of an XmlNode method object. Since an XmlNode cannot exist without its underlying XmlDoc, an XmlNode is deep copyable only, and no Copy method exists for an XmlNode. For more information about copyability, see Copying objects.

Syntax

  %dcop = %xmlobj:DeepCopy

Syntax Terms

%dcop
An XmlDoc or XmlNode object variable to contain the deep copy of %xmlobj. %dcop does not have to be empty (?? refid=dstates.).
%xmlobj
An XmlDoc or XmlNode object expression.

Usage Notes

  • The method object (%xmlobj) may be null. The output of a copy of a null object is a null object.
  • A deepCopy copies the underlying xmlDoc and sets the output xmlNode to the node in the new xmlDoc that corresponds to the input xmlNode. The AddSubtree method performs a different kind of copy: it copies a specified XmlNode and appends it to the method object.