Creates a new node in an existing XML file. Optionally assigns a value and attribute to the node. Used to create a new node or modify an existing node in a document tree.
|
AWE's XML actions require a basic understanding of XML and related terms, such as XPath, DTD and XSLT. |
Declaration
<AMXMLCREATENODE XPATH="text" NEWNODE="text" NEWVALUE="text" NODEWITHSAMENAMEEXISTTHEN="test (options)" DEFAULTNAMESPACE="text" DEFAULTNSPREFIX="text" INSERTAT="text (options)"><Attribute Name="text" Value="text" /></AMXMLCREATENODE>
Example
This sample step creates a node with name "Euro" and value "10" at XPath location "/bookstore/book/price". Session name is "XMLSession1". If a node with the same name already exists as a child, add the node anyway.
<AMXMLCREATENODE XPATH="/bookstore/book/price" NEWNODE="Euro" NEWVALUE="10" INSERTASFIRSTCHILD="YES" />
See Also: Dataset to XML, Delete XML Node, Edit XML Node, End XML Session, Evaluate Xpath Expression, Extract XML Fragment, Merge XML Files, Output XML, Read XML Node, Sign XML Document, Start XML Session, Transform XML, Validate XML File, Verify XML Document, XML Node to Dataset
Property |
Type |
Required |
Default |
Markup |
Description |
XPath Expression |
Text |
Yes |
(Empty) |
XPATH="/bookstore/book" |
The XPath expression to the XML node in which to create. |
Name |
Text |
Yes |
(Empty) |
NEWNODE="NodeName" |
The name of the new node to be created. |
Value |
Text |
No |
(Empty) |
VALUE="theValue" |
The value of the new node to be created. |
If node already exists |
Text (options) |
No |
Ignore |
NODEWITHSAMENAMEEXISTTHEN="Skip" |
Specifies what to do if a node with same name as the one being inserted at the current location already exists. The available options are:
|
Insert as first child node |
Yes/No |
No |
No |
INSERTASFIRSTCHILD="YES" |
If set to YES, allows you to insert the new node as a first child of the parent node found using Xpath Expression. The default value is set to NO.. |
Session Name |
Text |
No |
XMLSession1 |
SESSIONNAME="FirstXMLSession" |
The session name to identify the in-memory XML document to use in subsequent XML steps. This allows several in-memory XML documents to be active simultaneously. |
Property |
Type |
Required |
Default |
Markup |
Description |
Default namespace (optional) |
Text |
No |
(Empty) |
DEFAULTNAMESPACE="default" |
The default namespace. This parameter is optional. |
Prefix for default namespace (optional) |
Text |
No |
(Empty) |
DEFAULTNSPREFIX="thePrefix" |
The prefix associated to the default namespace. |
Insert node at |
Text (options) |
No |
Beginning of child nodes |
INSERTAT="after" |
Specifies where to insert the node onto the child node. Other parameters may become active depending on which option is selected. The available options are:
|
Specified child node name |
Text |
No |
(Empty) |
SPECIFIEDNODE="nodeName" |
The name of the child node. This option is active only if the Insert node at parameter is set to After specifies child node or Before specified child node. |
If specifies child node does not exist |
Text (options) |
No |
Skip |
SPECIFIEDNODENOTEXIST="fail" |
Specifies what to do if the specified child node does not exist. This option is active only if the Insert node at parameter is set to After specifies child node or Before specified child node. The available options are:
|
Use these properties to insert attributes into the new node.
Property |
Type |
Required |
Default |
Markup |
Description |
Attribute Name |
Text |
No |
(Empty) |
Name="AttributeName" |
The name of the attribute to insert. Once you have specified an attribute name/value, use the following buttons if needed:
|
Attribute value |
Text |
No |
(Empty) |
Value="AttributeValue" |
The value of the attribute. Once you have specified an attribute name/value, use the following buttons if needed:
|
Use these properties to insert namespace prefix and URI into the new node.
Property |
Type |
Required |
Default |
Markup |
Description |
Prefix |
Text |
No |
(Empty) |
PREFIX="PrefixName" |
The prefix associated to the added namespace. Once you have specified namespace properties, use the following buttons if needed:
|
Namespace URI |
Text |
No |
(Empty) |
URI="URIName" |
The URI associated to the added namespace. Once you have specified namespace properties, use the following buttons if needed:
|