XML - End session

Declaration

<AMXML ACTIVITY="end_session" text="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: The use of Automate Desktop's XML activities requires a fundamental understanding 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:
  • Copy and paste the sample AML code below directly into the Task Builder Steps Panel.
  • To successfully run the sample code, update parameters containing user credentials, files, file paths, or other information specific to the task to match your environment.

Description

This sample task ends an XML session.

Copy
<AMXML FILE="XMLFile" SESSION="XmlSession1" />
<AMXML ACTIVITY="node_to_dataset" SESSION="XmlSession1" XPATH="/bookstore/book" DATASETTYPE="attribute" ATTRNAME="category" RESULTDATASET="NodeSet" />
<AMLOOP ACTIVITY="dataset" DATASET="NodeSet" />
<AMSHOWDIALOG>%NodeSet.Value%</AMSHOWDIALOG>
<AMLOOP ACTIVITY="end" />
<AMXML ACTIVITY="end_session" SESSION="XmlSession1" />