Start XML Session Action

Description

Create a new XML session based on an XML file or specified text.  This session can be used in subsequent XML steps to modify an in-memory copy of the XML data.  Use Output XML or End XML Session to output the final XML. Used to create an in-memory XML document.

Declaration

<AMXMLSTARTSESSION XMLDOCUMENTFROM="text [options]" FILE="text" OVERWRITEFILE= "text [options]" XMLTEXT="text" ROOTNODENAME="text" NEWVALUE="text"><Attribute Name="text" Value="text" /></AMXMLSTARTSESSION>/>

Example

<AMXMLSTARTSESSION XMLDOCUMENTFROM="ExistingFile" FILE="c:\Automated Workflow.XML" />

<AMXMLSTARTSESSION XMLDOCUMENTFROM="NewFile" FILE="c:\log\logging.XML" ROOTNODENAME="Error" NEWVALUE="Automated Workflow Errors" OVERWRITEFILE="YES"> <Attribute Name="Version" Value="2.0" /></AMXMLSTARTSESSION>

<AMXMLSTARTSESSION XMLDOCUMENTFROM="Text" XMLTEXT="&lt;?XML version='1.0' encoding='UTF-8'?&gt;&#xD;&#xA;&lt;Marie /&gt;" />

General Tab Parameters

Start XML session from: Provides different options from which new in memory XML file can be created.

  • Existing File--allows you to browse for an existing XML file to use.

  • New File--allows you to create a new XML file to use.

  • Text--allows you to use specified XML text.

Text [options], Optional - Default "ExistingFile"
MARKUP: XMLDOCUMENTFROM="NewFile"

File: Specifies the path of the new or existing XML file. Only available if you select Existing File or New File for Start XML session from.

Text, Required
MARKUP: FILE="c:\foldername\file.XML"

Overwrite if file exists: If set to Yes, specifies that if the file already exists, it will be overwritten with the new document. If set to No, the step fails if the file already exists. Only available if you choose Existing File for Start XML session from.

Yes/No, Optional - Default "NO"
MARKUP: OVERWRITEFILE="YES"

Session name: Specifies 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.

Text, Optional - Default "XMLSession1"
MARKUP: SESSIONNAME="FirstXMLSession"

Text: Allows you to paste XML text directly into the text field. Only available if you choose Text for Start XML session from.

Text, Required
MARKUP: XMLTEXT="aaa"

Root node name: Provides the root node name for new XML file. Only available if you choose New File for Start XML session from.

Text, Required
MARKUP: ROOTNODENAME="Name"

Root node value (optional): Provides the root node value for new XML file. Only available if you choose New File for Start XML session from.

Text, Optional
MARKUP: NEWVALUE="Value"

Attributes Tab Parameters

The tab is unavailable unless you select New File for Start XML session from.

To insert attributes into new node

  • Provide a name in left bottom text box and a value in the right bottom text box, then click Add. The name and value appear in the list.

Name: Specifies the name of the attribute.

Text, Optional
MARKUP: Name="AttributeName"

Value: Specifies the value of the attribute.

Text, Optional
MARKUP: Value="Attribute Value"

Move Up: Moves a selected attribute up the list.

Move Down: Moves a selected attribute move it down the list.

Modify: Allows selected attribute names and values to be edited.

Remove: Removes a selected attribute.

Namespace Tab Parameters

To insert namespaces into new node

  • Provide a prefix in left bottom text box and a namespace URI in the right bottom text box, then click Add. The Prefix and Namespace URI appear in the list.

Prefix: Specifies the prefix of the namespace.

Text, Optional
MARKUP: Name="Prefix"

Namespace URI: Specifies the namespace URI.

Text, Optional
MARKUP: Value="NamspaceURI"

Move Up: Moves a selected namespace up the list.

Move Down: Moves a selected namespace move it down the list.

Modify: Modifies a selected namespace names and values.

Remove: Removes a selected namespace.

See Also

End XML Session Action