What is the XPath to use while defining a response output parameter to retrieve attributes from an XML service response

This thread was migrated from an old forum. It may contain information that are no longer valid. For further assistance, please post a new question or open a support ticket from the Customer Support portal.

Hi All,

This is an #[Informational Post]​

If we have a response from an XML service as shown below,

<?xml version="1.0" encoding="UTF-8"?>

<?xml-stylesheet href="/v1/xsl/xml_pretty_printer.xsl" type="text/xsl"?>

<products currentPage="1" from="1" to="0" totalPages="0" total="0" queryTime="0.022" totalTime="0.023" canonicalUrl="/v1/products(productId=1218088854917)?apiKey=3dhwjskv6rf7jr2wg8gj4rgx" partial="false"/>

to retrieve the attributes "totalPages","currentPage" from the above XML response, we can use the below XPath while defining the response output parameters.

  • For retrieving the totalPages attribute: //products/@totalPages
  • For retrieving the currentPage attribute: //products/@currentPage

Thanks and Regards

Thanks for sharing knowledge with the community!