CustomXMLNode.ReplaceChildSubtree Method
Removes the specified node (and its subtree) from the main tree, and replaces it with a different subtree in the same location.
Note
|
|---|
| References to DTDs from custom XML parts are not supported. DTD references in custom XML parts will not resolve, and custom XML parts containing DTD references generate an exception when an attempt is made to save the file's content to a flat XML file. |
Syntax
expression.ReplaceChildSubtree(XML, OldNode)
expression An expression that returns a CustomXMLNode object.
Parameters
| Name | Required/Optional | Data Type | Description |
|---|---|---|---|
| XML | Required | String | Represents the subtree to be added. |
| OldNode | Required | CustomXMLNode | Represents the child node to be replaced. |
Remarks
If the operation would result in an invalid tree structure, the replacement operation is not performed and an error message is displayed.
Example
The following example selects a custom part and then a node in that part. The code then replaces a child subtree of that node with another subtree.
| Visual Basic for Applications |
|---|
|
Note