Return option and XPath

The element to return is specified using an XPath subject to the following limitations:

  • The element to return must be a scalar type. That is, it cannot be an array or contain another element.
  • Only fully qualified paths are accepted, for example:


  • Attributes of elements can be specified using the standard XPath '@' notation, for example:


While the SOAP standard does not forbid the use of attributes, it recommends not using them.

No other XPath syntax is supported

The limitations in the previous examples are taken into consideration in the following sample message:

      <Price currency="dollar">20</Price>

The names of the elements in the path correspond to the name in the returned data. Therefore, if the -RAW command is used, the names correspond to the element names in the raw response message. In this case, the elements are often qualified by namespace prefixes.

Consider the following example return message:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV=
<SOAP-ENV:Body SOAP-ENV:encodingStyle="">
<NS1:BabelFishResponse xmlns:NS1="urn:BorlandBabelIntf-IBorlandBabel">
<return xsi:type="xsd:string">Freeend</return>

If we want to return only the <return> element, the following command(s) should be used:


Or, if the -RAW command is not specified:

-RETURN /BabelFishResponse/return