CustomXMLNode.InsertSubtreeBefore Method
Inserts the specified subtree into the location just before the context node.
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.InsertSubtreeBefore(XML, NextSibling)
expression An expression that returns a CustomXMLNode object.
Parameters
| Name | Required/Optional | Data Type | Description |
|---|---|---|---|
| XML | Required | String | Represents the subtree to be added. |
| NextSibling | Optional | CustomXMLNode | Specifies the context node. |
Remarks
If theparameter is not a child of the context node or if the operation would result in an invalid tree structure, the insertion is not performed and an error message is displayed.
Example
The following example adds a custom part and then finds a node in that part by using an XPath expression. The code then inserts a node after the found node.
| Visual Basic for Applications |
|---|
|
See also:
| NextSibling |
Note