XML - End Session
Declaration
<AMXMLENDSESSION SESSIONNAME="text" />
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.
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.
Session Parameters
Property |
Type |
Required |
Default |
Markup |
Description |
---|---|---|---|---|---|
Session |
Text |
Yes |
(Empty) |
SESSIONNAME="FirstXMLSession" |
The name of the session to end. |
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: 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 />