Monday, July 23, 2012
Illegal characters in path (XmlDocument.Load())
1:03 AM |
Posted by
Sheen |
Edit Post
This occurs due to not understanding the expected parameter type for the XmlDocument.Load("filename") method. This method expect a file name.
Look at the following example, this throw the above error.
eg:
//getting a soap response
string sXml = nc.CurrencyExchangeRatesForWeb();
XmlDocument doc = new XmlDocument();
doc.Load(sXml);
To avoid this error, we can use XmlDocument.LoadXml("string") method, following example shows the solution,
eg:
string sXml = nc.CurrencyExchangeRatesForWeb();
XmlDocument doc = new XmlDocument();
doc.LoadXml(sXml);
Happy coding
Look at the following example, this throw the above error.
eg:
//getting a soap response
string sXml = nc.CurrencyExchangeRatesForWeb();
XmlDocument doc = new XmlDocument();
doc.Load(sXml);
To avoid this error, we can use XmlDocument.LoadXml("string") method, following example shows the solution,
eg:
string sXml = nc.CurrencyExchangeRatesForWeb();
XmlDocument doc = new XmlDocument();
doc.LoadXml(sXml);
Happy coding
Subscribe to:
Post Comments (Atom)
Blog Archive
Important Blogs
-
-
BDD with Rails and Cucumber10 years ago
-
-
Watch Live Cricket Online Free14 years ago
-
BBC and Mahinda Rajapakshe15 years ago
-
-
0 comments:
Post a Comment