XML - End session

Declaration

<AMXMLENDSESSION SESSIONNAME="text" />

Related Topics  

Description

Ends the specified XML session. This unlocks the XML file bound to the XML session (if a file was used) and frees the session name to be used in a different session started by the XML - Create session activity.

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

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.

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

session

Property

Type

Required

Default

Markup

Description

Session

Text

Yes

XMLSession1

SESSIONNAME="myXMLSession"

The name of an existing XML session to end.

 

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

This sample task creates a dataset named "NodeSet" containing XML node values of type "AttributeValue" at XPath location "/bookstore/book". The dataset is then looped and a message box is appears within each iteration displaying the value.

 

<AMXMLNODEITERATOR XPATH="/bookstore/book" RESULTDATASET="NodeSet" VARVALUETYPE="AttributeValue" ATTRNAME="category" />

<AMLOOP TYPE="DATASET" DATASET="NodeSet">

     <AMSHOWDIALOG>%NodeSet.Value%</AMSHOWDIALOG>

</AMLOOP>

<AMXMLENDSESSION />