AnsweredAssumed Answered

Regarding 'XML Xpath Assertion'

Question asked by sum528 on Jun 29, 2018
Latest reply on Jul 2, 2018 by Joel NeSmith

Hi,

 

Consider the following xml request:

<?xml version="1.0"?>
<recordReq>

<TotalDetails> 2 </TotalDetails>

<CustomerDetails>

<itemId> 1234 </itemId>

<bank>
<name> xylo </name>
<branch>xyz</branch>
</bank>

</CustomerDetails>

<CustomerDetails>

<itemId> 7894 </itemId>

<bank>
<name> phone </name>
<branch> abc </branch>
</bank>

</CustomerDetails>

</recordReq>

 

Note: <CustomerDetails> section is repeating twice in this request

 

<CustomerDetails> section in the incoming request to the VS may repeat 'n' number of times. this is dynamic. <TotalDetails> field value in the request denotes the number of  <CustomerDetails> sections coming in the request. 

 

the requirement here is:  VS should ensure that for how many number of <CustomerDetails> sections repeating in the request, for all of it, the fields <name> and <branch> should always be present (which is mandatory).

 

 can this be achieved in XML Xpath Assertion using a single xpath query for each field for multiple occurences?

 

Ulrich_Vogt Chris_StalloneJ_NeSmithMarcyNunns

Thanks!

Outcomes