bob1barker
asked on
c# MLS Parsing, empty value error
I am parsing an XML file on the fly to show a single value inside the XML file. The code I have works great until we find a record that has no value in the xml file. I have tried a few things to make it only show up if there was a value but I haven't been able to figure it out.
any thoughts?
you can test it by changing the XML URL to a fake address and you will see the value I am using disappear.
XmlDocument doc = new XmlDocument();
string varURL = "http://www.zillow.com/webservice/GetSearchResults.htm?zws-id=X1-ZWz1cwo6lcszyj_aui2x&address=12598+Dupont+Drive&citystatezip=Rancho+Cucamonga+91739";
doc.Load(Server.UrlPathEnc ode(varURL ));
XmlNode root = doc.DocumentElement;
ZEstimate.Text = root.SelectSingleNode("//r esponse/re sults/resu lt/zpid"). ChildNodes [0].Value;
any thoughts?
you can test it by changing the XML URL to a fake address and you will see the value I am using disappear.
XmlDocument doc = new XmlDocument();
string varURL = "http://www.zillow.com/webservice/GetSearchResults.htm?zws-id=X1-ZWz1cwo6lcszyj_aui2x&address=12598+Dupont+Drive&citystatezip=Rancho+Cucamonga+91739";
doc.Load(Server.UrlPathEnc
XmlNode root = doc.DocumentElement;
ZEstimate.Text = root.SelectSingleNode("//r
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Not a problem, glad to help. ;=)
ASKER
thanks