clumsybiker
Programmer
I have the following xml:
<NLIS_MESSAGE xmlns=" xmlns:xsi=" xsi:schemaLocation=" Acknowledgement.xsd">
<MESSAGE_ACKNOWLEDGEMENT>
<RESPONSE_MNEMONIC>ACKNOWLEDGE</RESPONSE_MNEMONIC>
<ERROR_MNEMONIC>SUCCESS</ERROR_MNEMONIC>
</MESSAGE_ACKNOWLEDGEMENT>
</NLIS_MESSAGE>
This xml is loaded into an xmlDocument object in VB .NET.
As you can see it has several namespaces. I am struggling to understand how I can do a document.SelectSingleNode to get hold of the values of the Mnemomic fields in the message, to determine whether "Acknowledge" and "Success" are present.
When I do:
dim oNode as xmlnode = Document.SelectSingleNode("/NLIS_MESSAGE/MESSAGE_ACKNOWLEDGEMENT/RESPONSE_MNEMONIC")
I get oNode = Nothing
I've tried with a namespacemanager but still get nothing, but I think I don't know enough about namespaces / namespacemanagers to get it right.
Can anyone help?
Thanks,
<NLIS_MESSAGE xmlns=" xmlns:xsi=" xsi:schemaLocation=" Acknowledgement.xsd">
<MESSAGE_ACKNOWLEDGEMENT>
<RESPONSE_MNEMONIC>ACKNOWLEDGE</RESPONSE_MNEMONIC>
<ERROR_MNEMONIC>SUCCESS</ERROR_MNEMONIC>
</MESSAGE_ACKNOWLEDGEMENT>
</NLIS_MESSAGE>
This xml is loaded into an xmlDocument object in VB .NET.
As you can see it has several namespaces. I am struggling to understand how I can do a document.SelectSingleNode to get hold of the values of the Mnemomic fields in the message, to determine whether "Acknowledge" and "Success" are present.
When I do:
dim oNode as xmlnode = Document.SelectSingleNode("/NLIS_MESSAGE/MESSAGE_ACKNOWLEDGEMENT/RESPONSE_MNEMONIC")
I get oNode = Nothing
I've tried with a namespacemanager but still get nothing, but I think I don't know enough about namespaces / namespacemanagers to get it right.
Can anyone help?
Thanks,