XML - Import

Declaration

<AMXML ACTIVITY="import" XPATH="text" XPATHFILE="text" 
FILE="text" SESSION="text" />

Description: Merges two XML files together into a single file. XPaths can be provided to customize both insertion points into the host XML file as well as node offsets in the file being merged from. If the user provides the Xpath expression for File 2 then that XML fragment from File 2 is appended to File 1.

IMPORTANT: Use of XML activities require a basic interpretation of XML schema and general knowledge of XML related terms, such as Nodes, XPath, DTD and XSLT.

Practical Usage

Used for importing or inserting nodes in a specific location of an existing node.

Session Parameters

Property

Type

Required

Default

Markup

Description

Session

Text

Yes

XMLSession1

SESSIONNAME="myXMLSession"

The name of an existing session in which to associate this activity with. As a safety measure, when a session is created, the XML file bound by that session is saved in memory and the original file is locked. Any modifications by subsequent XML steps are performed on a copy of the XML data saved to memory. Linking several activities to a single session eliminates redundancy. Additionally, a single task supports simultaneous execution of multiple sessions, improving overall efficiency. Use the XML - Output file or XML - Save activity to output the in-memory representation of the XML session to a file or variable. To end the session, use the XML - End session activity. 

Node Parameters

Property

Type

Required

Default

Markup

Description

XPath expression (optional)

Text

No

(Empty)

XPATH="/Root1"

The file in which you want to store the fragment as a first child of root node.

File

Text

Yes

(Empty)

FILE="C:\Automate\Append.XML"

The file in which to merge into the current XML document.

XPath Expression for file (optional)

Text

Yes

(Empty)

XPATHFILE="/Root2"

The XPath expression identifying the offset node for second file.

Namespace Prefix

Text

No

(Empty)

PREFIX="PrefixName"

The prefix associated to the added namespace. Use this parameter to insert namespace prefix and URI values into the new node. To enter a new row of values select Click here to add new row... To delete an existing row, click the red "X". This parameter supports insertion of multiple namespace prefixes and URIs.

Namespace URI

Text

No

(Empty)

URI="URIName"

The URI associated to the added namespace. Use this parameter to insert namespace prefix and URI values into the new node. To enter a new row of values select Click here to add new row... To delete an existing row, click the red "X". This parameter supports insertion of multiple namespace prefixes and URIs

Description tab - A custom description can be provided on the Description tab to convey additional information or share special notes about a task step.

Error Causes tab - Specify how this step should behave upon the occurrence of an error. (Refer to Task Builder > Error Causes Tab for details.)

On Error tab - Specify what AWE should do if this step encounters an error as defined on the Error Causes tab. (Refer to Task Builder > On Error Tab for details.)

Example

The sample AML code below can be copied and pasted directly into the Steps panel of the Task Builder.

Description: Import node(s) from file "C:\Automate\Append.xml". Session "XmlSession1".

<AMXMLMERGEFILES FILEB="C:\Automate\Append.xml" />