1

I'm having some issues with my xpath queries in c#..

Given the xml of :

<BlahApi xsi:schemaLocation="https://api.blah.com/xsd/blah.xsd" Version="0.0.0.0" xmlns="Blah.Api" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <Status Code="0" Message="Success" NextID="0" NextCallTime="" />
    <ValidateCustomerAccountNumber>
        <Customer Name="Blah" ID="00000000-0000-0000-0000-000000000000" ApiToken="blah" ProfileId="blah" AdminEmail="[email protected]" CustomerEmail="" />
    </ValidateCustomerAccountNumber>
</BlahApi>

And code of:

var customerId = step1Response.XPathEvaluate("/BlahApi/ValidateCustomerAccountNumber/Customer/@ID");

I would expect to get the GUID for the Id back. But its empty. I've tried stripping this down to just a / and I get the whole document, but if I try to even do : "/BlahApi" it evaluates to nothing.

Not sure what I"m doing wrong. Thanks in advance.

2
  • 1
    Sounds like a namespace mismatch Commented Oct 12, 2017 at 21:55
  • If you're using the same xpath implementation, this might help: stackoverflow.com/questions/585812/… Commented Oct 12, 2017 at 21:58

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.