XML - Save

 

Declaration

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

Related Topics  

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 AutoMate's 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.

Parameters

session

Property

Type

Required

Default

Markup

Description

Session

Text

Yes

XMLSession1

SESSIONNAME="myXMLSession"

The name of an existing XML 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 instead of the original. 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. 

Save

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 Save to parameter set to New

(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 Save to parameter set to New

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 Save to parameter set 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. This parameter is available only if the Save to parameter is set to Variable.

Populate variable with value

Text

Yes if Save to parameter set to Variable

(Empty)

RESULTVARIABLE="XMLdata"

The name of an existing variable in which to output the XML data. This parameter is available only if the Save to parameter is set to Variable.

 

Description

Error Causes

On Error

example

NOTE: 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="Output_XML" />
Note : Putting the XML document data into Automate Variable.