tomandsandy
Programmer
I am trying to parse a DOM object in C#. I know the source of the failure but I do not know the reason for its failure.
I am searching for a tag called <mimeType>jpeg</mimeType> using:
XmlNode bookNode = xmldoc.SelectSingleNode("//mimeType");
//Determine whether a matching node is located.
if (!(bookNode == null))
{
System.Diagnostics.Debug.WriteLine("Located base64 Image Data");
System.Diagnostics.Debug.WriteLine bookNode.FirstChild.Value);
}
It works if
I manually edit the root element. The root element is returned from a web service and conatins an xmlns attribute:
<EDXLDistribution xmlns="urnasis:names:tc:emergency:EDXLE:1.0">
If I perform the Select SingleNode on the DOM with the xmlns it fails every time. if i remove the xmlns="urnasis:names:tc:emergency:EDXLE:1.0" attribute from the root element, the SelectSingleNode succeeds every time.
Why does this matter?
Thank You
Tom
I am searching for a tag called <mimeType>jpeg</mimeType> using:
XmlNode bookNode = xmldoc.SelectSingleNode("//mimeType");
//Determine whether a matching node is located.
if (!(bookNode == null))
{
System.Diagnostics.Debug.WriteLine("Located base64 Image Data");
System.Diagnostics.Debug.WriteLine bookNode.FirstChild.Value);
}
It works if
I manually edit the root element. The root element is returned from a web service and conatins an xmlns attribute:
<EDXLDistribution xmlns="urnasis:names:tc:emergency:EDXLE:1.0">
If I perform the Select SingleNode on the DOM with the xmlns it fails every time. if i remove the xmlns="urnasis:names:tc:emergency:EDXLE:1.0" attribute from the root element, the SelectSingleNode succeeds every time.
Why does this matter?
Thank You
Tom