Create XML Node Action

Description

Creates a new node in an existing XML file. Optionally assigns a value and attributes to the node.

Declaration

<AMXMLCREATENODE XPATH="text" NEWNODE="text" NEWVALUE="text"><Attribute Name="text" Value="text" /></AMXMLCREATENODE>

Example

<AMXMLCREATENODE XPATH="/BookStore/Book" NEWNODE="Author" NEWVALUE="Albert" INSERTASFIRSTCHILD="YES" NODEWITHSAMENAMEEXISTTHEN="Skip"><Attribute Name="LastName" Value="BlackWell" /></AMXMLCREATENODE>

General Tab Parameters

XPath expression: Allows you to browse the node in current XML document to modify it.

Text, Required
MARKUP: XPATH="/Marie"

Name: Specifies the name of the new node you are creating.

Text, Required
MARKUP: NEWNODE="NODENAME"

Value: Specifies the value of the new node you are creating.

Text, Optional
MARKUP: NEWVALUE="NODEVALUE"

If node already exists: Specifies what to do if a node with same name as the one you are trying to insert at the current location already exists. Ignore is the default.

Ignore--Directs the action to create a new node regardless of whether other nodes with the same name exist.

Skip--Directs the action to skip a child node if any child nodes exist with the same name as the new node.

Overwrite--Directs the action to overwrite any child nodes it finds that have the same name as the new node. If multiple child nodes with the same name exist, the action creates only one of them and erases the rest.

Fail--Tells the action that if any child nodes exist with the same name, the action will fail.

Text [Options], Optional Default "Ignore"
MARKUP:
NODEWITHSAMENAMEEXISTTHEN="Skip"
NODEWITHSAMENAMEEXISTTHEN="Overwrite"
NODEWITHSAMENAMEEXISTTHEN="Fail"

Insert as first child node: If checked, allows you to insert the new node as a first child of the parent node found using Xpath Expression. Default is unchecked.

Yes/No, Optional - Default "NO"
MARKUP: INSERTASFIRSTCHILD="YES"

Session name: Specifies 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.

Text, Optional - Default "XMLSession1"
MARKUP: SESSIONNAME="FirstXMLSession"

Attributes Tab Parameters

To insert attributes into new node

  • Provide a name in left bottom text box and a value in the right bottom text box, then click Add. The name and value appear in the list.

Name: Specifies the name of the attribute.

Text, Optional
MARKUP: Name="AttributeName"

Value: Specifies the value of the attribute.

Text, Optional
MARKUP: Value="Attribute Value"

Move Up: Moves a selected attribute up the list.

Move Down: Moves a selected attribute move it down the list.

Modify:  Allows selected attribute names and values to be edited.

Remove: Removes a selected attribute.

Namespace Tab Parameters

To insert namespaces into new node

  • Provide a prefix in left bottom text box and a namespace URI in the right bottom text box, then click Add. The Prefix and Namespace URI appear in the list.

Prefix: Specifies the prefix of the namespace.

Text, Optional
MARKUP: Name="Prefix"

Namespace URI: Specifies the namespace URI.

Text, Optional
MARKUP: Value="NamspaceURI"

Move Up: Moves a selected namespace up the list.

Move Down: Moves a selected namespace move it down the list.

Modify: Modifies a selected namespace names and values.

Remove: Removes a selected namespace.

See Also

Delete XML Node Action, Edit XML Node Action