문제

First of all, Sorry if I do mistake in my question. I'm french and not the best in english. I have a problem with a Xquery Match in Soapui. There is an exemple of a Soapui response:

<ns0:Group>
     <ns0:Personne>
        <ns0:idPersonne>111</ns0:idPersonne>
     </ns0:Personne>
     <ns0:Personne>
        <ns0:idPersonne>222</ns0:idPersonne>
     </ns0:Personne>
     <ns0:Personne>
        <ns0:idPersonne>333</ns0:idPersonne>
     </ns0:Personne>
</ns0:Group>

I need to check if the Id of a personne is unique or not. If "111" appears only once, it returns "true" If not, it returns "false". Could you help me?

도움이 되었습니까?

해결책

This should do the trick for you:

count(distinct-values(//ns0:idPersonne)) eq 1

I am not that familiar with Soap UI though, so if you have trouble with namespaces you might also like to try instead:

count(distinct-values(//*:idPersonne)) eq 1
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top