I am trying to use the SelectSingleNode function, but it is not returning anything. My code is as follows:
The xml looks like this:Code:XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(@"c:\sample.xml"); XmlNode node = xmlDoc.SelectSingleNode("//Response/ResponseRecord");
I think it may have something to do with the "xmlns".HTML Code:<?xml version="1.0" encoding="utf-8"?> <Response xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Prod_Name="ProductX" Version="1.0.0.1" TimeStamp="8/14/2007 2:56:45 PM"> <ResponseRecord xmlns="urn:MyService"> <recordID>0</recordID> </ResponseRecord> </Response>




Reply With Quote