Top
Systemwalker Runbook Automation Studio User's Guide
Systemwalker

6.4.13 Extract XML attribute Filter

This filter extracts attribute values from the results of an operation component or in filter output that are in XML format.

[XPath]

Enter the path of the element that holds the attribute. The input can be up to 4096 characters long. To embed the variable (UDA) value and execution results of the previous operation component in the XPath field when the filter is applied, follow the steps below:

  • To embed the value, specify "@{uda: variable name}" or click the Browse variables button and select a variable from the Browse variables dialog box.

    The types of variables (UDA) available are STRING/INTEGER.

  • To embed the execution results of the previous operation component, specify "@{:node name:execution results}" or click the Browse execution results button and select an execution result from the Browse execution results dialog box.

The filter will end in an error if the field is empty.

Attribute name

Enter the name of the attribute to be used to extract the value. The input can be up to 512 characters long.

The filter will end in an error if the field is empty.

Select multiple

Select to extract all results when multiples exist. Only the first result is extracted if this checkbox is cleared.

The default is on.

Delimiter

Select the delimiter for extracted results (values). This is not used if only one item is extracted.

  • Comma

  • Spaces

  • Tab

  • Linefeed [LF] (Default)

Enclose with

Select the character for enclosing extracted results (values):

  • Double quotes (Default)

  • Single quote

  • None

If "Line feed" is selected for Delimiter, Enclose with is grayed out and ignored.

Note

Precautions when Testing Filters

  • If "@{uda:variable name}" is specified in the XPath field:

    The test will use the value assigned in the Set test variables dialog box (*1), or the string "@{uda:variable name}" if no value is assigned.

  • If "@{:node name:execution results}" is specified in the XPath field:

    The test will use the value assigned in the Set test variables dialog box (*1), or the string "@{:node name:execution results}" if no value is assigned.

  • When the filter is executed on the Management Server, these variables (UDA) or execution results are replaced with the stored values.

*1: Refer to "6.3.2 Testing Filters" for information on the Set test variables dialog box.

Example 1:

Input:

<systems>
  <system name="system A" mail="user1@example.com">
    <servers>
      <server ipaddress="192.168.1.10"/>
      <server ipaddress="192.168.1.20"/>
    </servers>
  </system>
  <system name="system B" mail="user2@example.com">
    <servers>
      <server ipaddress="192.168.2.10"/>
      <server ipaddress="192.168.2.20"/>
      <server ipaddress="192.168.2.30"/>
    </servers>
  </system>
</systems>

XPath:

/systems/system [@name='system A'] /servers/server

Property Name:

ipaddress

Select multiple:

On

Delimiter:

Linefeed character

Enclosed alphanumerics:

-

Output:

192.168.1.10[linefeed]
192.168.1.20[linefeed]
Example 2:

Input:

<systems>
  <system name="system A" mail="user1@example.com">
    <servers>
      <server ipaddress="192.168.1.10"/>
      <server ipaddress="192.168.1.20"/>
    </servers>
  </system>
  <system name="system B" mail="user2@example.com">
    <servers>
      <server ipaddress="192.168.2.10"/>
      <server ipaddress="192.168.2.20"/>
      <server ipaddress="192.168.2.30"/>
    </servers>
  </system>
</systems>

XPath:

/systems/system [@name='system A'] /servers/server

Property Name:

ipaddress

Select multiple:

On

Delimiter:

Comma

Enclosed alphanumerics:

Double quotes

Output:

"192.168.1.10","192.168.1.20"
Example 3:

Input:

<systems>
  <system name="system A" mail="user1@example.com">
    <servers>
      <server ipaddress="192.168.1.10"/>
      <server ipaddress="192.168.1.20"/>
    </servers>
  </system>
  <system name="system B" mail="user2@example.com">
    <servers>
      <server ipaddress="192.168.2.10"/>
      <server ipaddress="192.168.2.20"/>
      <server ipaddress="192.168.2.30"/>
    </servers>
  </system>
</systems>

XPath:

/systems/system [@name='system A'] /servers/server

Property Name:

ipaddress

Select multiple:

Off

Delimiter:

Linefeed character

Enclosed alphanumerics:

-

Output:

192.168.1.10[linefeed]
[xample 4: If "System A" is set in variables (SystemName)

Input:

<systems>
  <system name="System A" mail="user1@example.com">
    <servers>
      <server ipaddress="192.168.1.10"/>
      <server ipaddress="192.168.1.20"/>
    </servers>
  </system>
  <system name="System B" mail="user2@example.com">
    <servers>
      <server ipaddress="192.168.2.10"/>
      <server ipaddress="192.168.2.20"/>
      <server ipaddress="192.168.2.30"/>
    </servers>
  </system>
</systems>

XPath:

/systems/system[@name='@{uda:SystemName}']/servers/server

Property Name:

ipaddress

Select multiple:

On

Delimiter:

Line feed

Enclosed alphanumerics:

-

Output:

192.168.1.10[linefeed]
192.168.1.20[linefeed]