0

How can i get the "273" value of ns1:bookId, when I have an xml response like this:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Header/>
   <soap:Body xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
      <ns2:createResponse ns1:bookId="273" xmlns:ns1="http://www.example.com/">
   </soap:Body>
</soapenv:Envelope>

SoapUI doesn't accept this pattern: //ns2:createResponse/@ns1:bookId

2
  • Don't bother with it, I just copied a random part of an xml. The question is how do you define an Xpath for that namespace? Commented Oct 19, 2022 at 6:39
  • Does this answer your question: stackoverflow.com/a/49851246/3710053 Commented Oct 19, 2022 at 7:27

1 Answer 1

1

You can ignore namespaces in XPath:

//*[local-name()="createResponse"]/@*[local-name()="bookId"]
Sign up to request clarification or add additional context in comments.

1 Comment

I think you probably intended to call local-name() rather than name().

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.