Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

USE:

XPath expressions are used to operate on XML messages.

Info

Please note that all XPATH expressions that point to the node values should be ended with with /text(), while the expressions that points point to Attribute value should be ended just with attribute name. 

All variables xpatch XPath expressions should refer to values, not nodes.

EXAMPLES:

Example 1: 
Sample XML for which the expressions will be presented:

...

      </E1EDL22>
</E1EDL20>
</IDOC>
<DELVRY07>

//E1EDL20/VBELN/text() points  points just to field value. The different value will be allowed

//E1EDL20/VBELN points  points to a node , so will allow that node will exist in reference or current run and will be missing in another

...

Another example is ignoring the XML namespace, for example, if you would like to compare the execution of enterprise service on different environmentenvironments. Sample XML:

<?xml version="1.0" encoding="UTF-8"?>
<n0:ServiceOrderQuotationCRMByIDResponse_sync xmlns:n0="http://sap.com/xi/CRM/SExmlns:prx="urn:sap.com:proxy:OC1:/1SAI/TASC5D32AE048B38AAA2236:740xmlns:n1="urn:customer.com:A:HYBRIS:eCommerce">
 <ServiceOrderQuotation>

...

and we would like to ignore the xmlns:prx namespace, then xpath XPath expression should look like the following:

//n0:ServiceOrderQuotationCRMByIDResponse_sync/@prx

...

Example 3:

In this example, the message contains the default namespace but without the prefix:

...

//*:PostInvoice/transferId/text() or

/*[local-name()="PostInvoice"]/transferId/text() 


Examples We provided some examples for non-XML payloads (like EDIFACT) are described on this this page.


Info

It is possible to combine more than one expression in Variable Processing settings using '||' operator. Each sub-expression separated with '||' is evaluated separately evaluated separately, and the result is combined.

E.g. it is possible to configure variable PURCHASE_ORDER with following expression: //ns0:PurchaseOrder/@PurchaseOrderNumber||//ns0:PurchaseOrder/Header/Number/text()

During runtime, values from both PurchaseOrderNumber attribute and Number node will be stored in the variable.

...