TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Ellen Hu
NA
63
0
hexadecimal value XXXX, is an invalid character When reading XML file
Mar 7 2011 6:24 PM
Hi All,
I have a link of http://www.idealist.org/feeds/volop_en.xml.bz2, from this link to download a zip file, and read its XML to store into SQL server 2008.
Had tried both:
XmlTextReader reader = new XmlTextReader("C:\\volop_en.xml");
while (reader.Read())
{
//
}
AND
byte[] originalData = null;
string strUrl = "C:\\volop_en.xml";
WebClient wc = new WebClient();
try
{
originalData = wc.DownloadData(strUrl);
}
catch (WebException)
{
// do nothing
}
if (originalData != null)
{
MemoryStream stream = new MemoryStream(originalData);
XmlDocument doc = new XmlDocument();
doc.Load(stream);
}
Both gets error says " hexadecimal value XXXX, is an invalid character. Line XXXXX, position XXX." If I manually remove that illegal character using replacing all at "volop_en.xml", will have another illegal character comes out.
Since this is a large file, and this source XML file will be updated daily. It seems hard to use replace function, is there a way to ignore those characters? or other suggestion?
Thank you for your time,
ellen
Reply
Answers (
1
)
Dynamic Bind Grid in asp.net?
progress bar is not working in IE