I'm working with an XML document that contains a structure that looks similar to this:
<MT>
<Events>
<event id="1">
<field name="blah" value="a_value" type="atype" />
.
.
.
</event>
</Events>
</MT>
I'm currently loading this from a file into an XML document in this fashion:
XmlDocument xdoc = new XmlDocument();
xdoc.Load("somefile.xml"); //Successfully loads btw
However I'm running into a problem and only with this one particular document when I try to run the next line of code:
xdoc.SelectSingleNode("//event[@id='1']"); //This returns a null
Am I on the right track by guessing that this is returning null because of an issue with using an attribute named 'id' or am I missing something in code?