I receive an XML file which has on the root node a xmlns namespace assigned:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Message xmlns="http://www.myAddress.com/DataRequest/message/">
<Date>2017/01/01</Date>
</Message>
I do not know how to retrive the Date element using XPath, I tried
var root = xDocument.Root;
var dateElement = root.XPathSelectElement("/Message/Date");
If I remove the namespace from the root xml, then I can retrieve the value using "/Message/Date".
I tried to add xmlns to a XmlNamespaceManager, but I get this error:
Prefix "xmlns" is reserved for use by XML.
How can I get the value?