I have XML in this example format:
<ExternalEvent xmlns="http://www.redeyedmonster.co.uk/Integration/ESB">
<EventType>Create</EventType>
<Message>SomeMessage</Message>
<ServiceRequestId>75a144b8-5a11-e311-bd23-0050569f00cc</ServiceRequestId>
<SourceSystem>MySource</SourceSystem>
</ExternalEvent>
and I am stuck with it.
I am trying to evaluate the value of the EventType node. I have tried:
/ExternalEvent/EventType
and
/*[local-name() = 'ExternalPath' and *[local-name() = 'EventType']]
and
/*[local-name()='ExternalEvent' and namespace-uri()='http://www.redeyedmonster.co.uk/Integration/ESB']/*[local-name()='EventType' and namespace-uri()='http://www.redeyedmonster.co.uk/Integration/ESB']
plus many other variations. However in XPath Tester I always get the same error which is:
The default (no prefix) Namespace URI for XPath queries is always '' and it cannot be redefined to 'http://www.redeyedmonster.co.uk/Integration/ESB'.
If I remove the namespace phrase (xmlns="http://www.redeyedmonster.co.uk/Integration/ESB") from the XML then I am able to evaluate the value of event type no problem but unfortunately I am stuck with XML in this format and it cannot be changed for my solution.
Is there a way round this? As I believe it may be the the underlying cause of a routing problem I have in my ESB solution.