AnsweredAssumed Answered

XPATH with an output of NSQL query

Question asked by kduchacek on May 15, 2014
Latest reply on May 16, 2014 by kduchacek

Hi

Does anybody have an experience with XPATH query that reads an output of NSQL query?

I am trying to select “unique_name”. The problem could be with many namespaces – especially (xmlns=”http://www.niku.com/xog/Query”)

I got some result when I used:

XPATH /soapenv:Envelope

XPATH  /soapenv:Envelope/soapenv:Body

But not

/soapenv:Envelope/soapenv:Body/QueryResult   (if I deleted namespaces  i got some result)

 

The input XML:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

  <soapenv:Header/>

  <soapenv:Body>

    <QueryResult xmlns="http://www.niku.com/xog/Query">

      <Code>test_q1</Code>

      <Records>

        <Record>

          <id>5000001</id>

          <unique_name>xc_admin</unique_name>

          <last_name>Administrator</last_name>

        </Record>

        <Record>

          <id>5001001</id>

          <unique_name>test1</unique_name>

          <last_name>test1</last_name>

        </Record>

      </Records>

      <Slice>

        <Number>0</Number>

        <Size>2</Size>

        <Total>2</Total>

      </Slice>

    </QueryResult>

  </soapenv:Body>

</soapenv:Envelope>

Outcomes