Knowledge limitation in XmlTextReader
Hi Guys,
I am currently facing a problem with XmlTextReader. I use XmlTextReader.Read() to read an xml document. Following is a portion of the document:
<title> XML & XHTML </title>
What I would like to do is to copy the whole text without any modification on it and assign it to a string, xmlDoc.
Therefore the expected result is:
xmlDoc = " XML & XHTML "
However, XmlTextReader.Read() automatically converts that text into " XML & XHTML ". So the result that I get is:
xmlDoc = " XML & XHTML "
May I know, is there any solution to solve this problem? I have been thinking of the char by char checking. After detecting the char "&" then assign "&" to the string. But this way is not practical at all because other than "&", we still have many special character like ©, <, >, etc
I would appreciate any reply, thank you
Re: Knowledge limitation in XmlTextReader
Well if you do end up doing char-by-char checking, you can just read from the & through the ; and convert that to the string.
Re: Knowledge limitation in XmlTextReader
But in that case the work will become tedious. Is it no other way to solve this out?