Forum Discussion

Mason_Foley's avatar
Mason_Foley
New Contributor
16 years ago

Not sure why this XPath conditional GoTo is failing

Here is the response I'm attempting to test:

<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
  <S:Body>
      <ns3:searchContactResponse xmlns:ns6="http://pat.att.com/webService/Folder" xmlns:ns5="http://pat.att.com/webService/Group" xmlns:ns4="http://pat.att.com/webService/Subscriber" xmlns:ns3="http://pat.att.com/webService/Contact" xmlns:ns2="http://pat.att.com/webService/Common">
        <ns3:quickContactItems>
            <ns2:currentPageIndex>1</ns2:currentPageIndex>
            <ns2:totalRecords>1</ns2:totalRecords>
            <ns2:totalPages>1</ns2:totalPages>
            <ns2:previousPage>0</ns2:previousPage>
            <ns2:nextPage>0</ns2:nextPage>
            <ns3:items>
              <ns3:id>12444</ns3:id>
              <ns3:firstName>Quality</ns3:firstName>
              <ns3:lastName>Assurance</ns3:lastName>
            </ns3:items>
        </ns3:quickContactItems>
      </ns3:searchContactResponse>
  </S:Body>
</S:Envelope>


This is the statment I'm attempting to run against the response:

declare namespace ns3='http://pat.att.com/webService/Contact';
declare namespace ns2='http://pat.att.com/webService/Common';
contains(/ns3:quickContactItems/ns2:totalRecords, "1")


However, the test always indicates:

No condition true for current response in [searchContact - Request 1]


Based on what I understand, that statement should evaluate to true.
  • Figured it out.  I was attempting to find ns2 from the root (using "/") instead of anywhere in the document (using "//")