XML - Save

Declaration

<AMXMLOUTPUT OUTPUTTYPE="text [options]" XMLFILETYPE="text [options]" 
XMLDESTINATION="text" OVERWRITEFILE="text [options]" />

Description: Saves the in-memory representation of the XML session, for example, to a file or variable before ending the XML session. Using this action does not end the session, thus allowing subsequent XML steps to continue using the session.

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

Outputs XML data currently saved onto a document or variable.

Session Parameters

Property

Type

Required

Default

Markup

Description

Session

Text

No

(Empty)

SESSIONNAME="FirstXMLSession"

The name of the session to save.

Save Parameters

Property

Type

Required

Default

Markup

Description

Save to

Text (options)

Yes

New

  1. SAVEMODE="new_file"

  2. SAVEMODE="original_file"

  3. SAVEMODE="variable"

Specifies where the XML file/data should be saved to. The available options are:

  • New (default) - Save XML to a new file.

  • Original - Save XML to original file. During Create session step, if new file is created or existing file is used, then this option will use that file to store the modified XML document.

  • Variable - Save XML to variable.

File

Text

Yes if XML is saved to new file

(Empty)

XMLDESTINATION="c:\temp\file.xml"

The path and filename to save the XML data. This parameter is available only if the Save to parameter is set to New.

Overwrite if file exists

Yes/No

Yes if XML is saved to new file

No

OVERWRITEFILE="YES"

If set to YES, if an XML file with the same name exists in the destination, it will be overwritten. If set to NO, an error will occur as a result of matching XML files. This parameter is set to NO by default and is active only if the Save to parameter is set to New.

Decode XML value

Yes/No

Yes if XML is saved to variable

No

DECODEXML="YES"

If set to YES, reverses the transformation for all the encoding methods. If set to NO (default) no decoding will take place. Encoding XML allows colons in any position, which means that the name may still be invalid according to the W3C Namespaces in XML Recommendation.

Populate variable with value

Text

Yes if XML is saved to variable

(Empty)

RESULTVARIABLE="XMLdata"

The name of an existing variable in which to output the XML data.

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: Output XML to variable.

<AMXMLOUTPUT OUTPUTTYPE="File" XMLFILETYPE="Original" />
Note : Outputing the changes into samefile
<AMXMLOUTPUT OUTPUTTYPE="Variable" RESULTVARIABLE="OutputXML" />
Note : Putting the XML document data into Variable.