_tsbWA-XpathSelect-Misc

_tsbWA-XpathSelect-Misc

<TResult>

The 'TResult' as part of an Activity name indicates that the Activity can create different types of output (for example String, Int etc.).

Options

Option
What is it
How to use it
Path

 

Local path to the XML file that contains the node(s) you want to work with.

Enter an absolute path to the XML file, that includes file name and file extension.

Enter one of the following values:

 Read more
  • Constant.
  • Variable, of the type string.
    • Use the variable editor at the bottom of the Workflow Studio screen to define a variable.
  • A VB expression that results in a string.

Xpath query


 

The xpath query to reach the node(s) that you want to work with.

Enter an xpath query. Example:

/INVOICES/INVOICE
XML namespacesUse to indicate which XML vocabularies (i.e. a set of names) are used in the document. Only use this option when the document uses namespaces.

Click on 'Define' to provide:

  • URI of the namespace.
  • Prefix for the namespace.

 

 Read more

Documents reference a namespace in two ways:

  • URI, example:

    xmlns="http://example.com/ns/person"
  • Prefix, example:

    xmlns:hr="http://example.com/ns/person"

    Which enables you to reference the namespace without using the long URI. Example:

    <hr:name>John Doe</hr:name>
MapInformational element.Do not change unless you want to change the name of the variables used in the assign. The variable item is of the type that is specified in Result type. The variable node is of type XmlNode.
SequenceOption to be able to do additional modifications to the data that you are mapping.
  • Let the Assign Activity be a permanent Activity of the sequence.
  • Optionally add other Activities to transform node to the type of item.
Assign

 

This assigns the result of any transformations done in Sequence to the variable item. 

Result type


 

With the xpath you will have obtained a certain value. This value should be stored in a target variable. However, you should first indicate the data type (result type) in order to store it correctly.
  • Use the dropdown menu to indicate the type of value you would like to store the result value.
  • Set the result type to the same data type of the transformation of the source node.
    • Example: If the source node contains a string and is assigned to an item of type 'String', set the result type to 'String'.
Result

 

Option to save the result(s) to a variable, for use later in the Workflow.

Create a variable to save the result(s) to, of the previously set result type.

 Read more
Why do I need variables

You can use variables to create a more flexible and sustainable Workflow.

Variables are mostly used in advanced Activities such as the Diversity Activities. These Activities often have two parts:

  • One part is to identify where to get data that serves as input for the Activity.
  • One part is to identify where to store data that serves as output for the Activity.

For the Diversity Activities it is common to store the data resulting from the Activity into a variable. Once stored in the variable, you can re-use the stored value elsewhere in the Workflow, by referring to the variable.

To create a variable to store data
  1. Click on the Variables button, below the Workflow. a panel will appear, containing an editable table.
  2. In the table click on 'Create variable' to start creating a new variable.
  3. Provide a name for the variable, preferably a name that describes its contents. Use camel case.
  4. Indicate the type of variable (e.g. boolean, integer, string, etc.). You can find specific types using 'Browse for types...'.
  5. Moving to another row saves this data to a new entry.

You can now use the name of this variable into one of the fields of the current Activity, or in Activities that are next.

All Xpath Activities