|
XML - End session |
Declaration
<AMXML ACTIVITY="end_session" text="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.
Parameters
Session
Property | Type | Required | Default | Markup | Description |
---|---|---|---|---|---|
Session | Text | Yes | XMLSession1 | SESSIONNAME="myXMLSession" | The name of an existing XML session to end. |
Example
- The sample AML code below can be copied and pasted directly into the Steps Panel of the Task Builder.
- Parameters containing user credentials, files, file paths, and/or other information specific to the task must be customized before the sample code can run successfully.
Description
This sample task ends an XML session.
<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" />