Karate 空手道:匹配xml中的重复元素

Karate 空手道:匹配xml中的重复元素,karate,Karate,我正在尝试将xml中的重复元素与空手道模式匹配 XML消息 * def xmlResponse = """ <Envelope> <Header/> <Body> <Response> <Customer> <keys> <primaryKey>1111111</primaryKey>

我正在尝试将xml中的重复元素与空手道模式匹配

XML消息

* def xmlResponse =
"""
<Envelope>
   <Header/>
   <Body>
      <Response>
         <Customer>
            <keys>
               <primaryKey>1111111</primaryKey>
            </keys>
            <simplePay>false</simplePay>
         </Customer>
         <serviceGroupList>
            <serviceGroup>
               <name>XXXX</name>
               <count>1</count>
               <parentName>DDDDD</parentName>
               <pendingCount>0</pendingCount>
               <pendingHWSum>0.00</pendingHWSum>
            </serviceGroup>
            <serviceGroup>
               <name>ZZZZZ</name>
               <count>0</count>
               <parentName/>
               <pendingCount>3</pendingCount>
               <pendingHWSum>399.00</pendingHWSum>
            </serviceGroup>
         </serviceGroupList>
      </Response>
   </Body>
</Envelope>
"""

但它不起作用。你知道我该怎么做吗?你必须匹配每个服务组

* xml serviceGroupListItems = get xmlResponse //serviceGroupList
* match each serviceGroupListItems.serviceGroupList.serviceGroup == serviceGroupItem.serviceGroup

另外,如果您想了解更多信息,可以查看这里:,但匹配xml仍然不是那么容易。
  * xml serviceGroupListItems = get xmlResponse //serviceGroupList
  * match each serviceGroupListItems == serviceGroupItem
* xml serviceGroupListItems = get xmlResponse //serviceGroupList
* match each serviceGroupListItems.serviceGroupList.serviceGroup == serviceGroupItem.serviceGroup