XML - Save

Declaration

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

See Also

XML - Create Node | XML - Create Session | XML - Dataset to XML | XML - Delete Node | XML - Edit Node | XML - End Session | XML - Evaluate Xpath | XML - Export | XML - Import | XML - Node to Dataset | XML - Read Node | XML - Sign | XML - Transform | XML - Validate | XML - Verify

Output XML

Declaration

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

See Also

Create XML Node | 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

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: AutoMate's XML actions require a basic understanding of XML and related terms, such as XPath, DTD and XSLT.

Practical Usage

Outputs XML data currently saved onto a document or variable.

NOTE: When creating an XML task, it is required that an XML session name is initially generated using the Start XML Session action. This session can be identified by subsequent XML steps which include the same session name. This allows several XML documents to be active simultaneously within the same task. When an XML session is created, the XML file bound by that session becomes locked. An End XML Session action can be used to end the current session. This frees the session name to be used in a different session and unlocks the XML file bound to that session.

During an XML session, modifications are not performed on the original XML file bound by that session. Rather, as a safety measure, a copy of the file is saved to memory upon the creation of a session. Any modifications performed by subsequent XML steps are performed on the copy of the XML data saved to memory. The Output XML File action can be used to output the in-memory representation of the XML session to a file or variable before ending the XML session. Using this action does not change the XML or end the session, thus allowing subsequent XML steps to continue using the session.

Parameters

General Properties

Property

Type

Req'd

Default

Markup

Description

Output to

Text (options)

Yes

File

OUTPUTTYPE="Variable"

Specifies where to store the XML document after you have modified it using different XML actions. The available options are:

  • File - Use this option if you want to store it in new file or an original file.

  • Variable - Use this option if you want to store XML data into an Automate variable.

Save XML Document To

Text (options)

No

New File

XMLFILETYPE="Original"

Specifies the file you want to save the XML document into. This option only appears if you select the File option under the Output To drop-down. The available options are:

  • New File - Stores the current XML document into new file

  • Original File - During Start XML Session if new file is created or existing file is used, then this option will use that file to store the modified XML document.

Output XML File

Text

No

(Empty)

XMLDESTINATION="a"

The destination XML file. This parameter is active only if the Save XML Document To parameter is set to New File.

Overwrite if file exists

Yes/No

No

No

OVERWRITEFILE="YES"

If set to YES, any output XML file that already exists will be overwritten. This parameter is set to NO by default and becomes active only if the Save XML Document To parameter is set to New File.

Session Name

Text

No

(Empty)

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.

Description Properties

The Description tab allows you to customize the text description of any step as it appears in the Task Builder's Steps Pane.

More on setting custom step description

Error Causes Properties

The Error Causes tab properties lets you instruct a task step to react only to specific errors or ignore certain errors that should cause it to fail.

More on Error Causes properties

On Error Properties

The On Error tab properties lets you determine what the task should do if a particular step encounters an error as defined in the Error Causes properties.

More about On Error properties

Additional Notes

Expressions, Variables & Functions

A percent sign is used as a special character in AutoMate to indicate the beginning and end of an expression. This allows variables, functions and other expressions to be entered in any text parameter of a task's properties. For example: %1+1% inside a task will resolve to 2 at runtime. A more elaborate example is %FileDateTime(myFile)% which results to the date/time of myFile. To help construct expressions, you can open Expression Builder by clicking the Insert Expression (%) button or by pressing F2.

More on expressions

More on variables

More on functions

More on extended functions
More on the expression builder

Example

NOTE: The code below can be copied and pasted directly into the Steps pane 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 Automate Variable.   

 

↑ Top of Page