Interviews4 answers
I'm using DataSet.ReadXML method to populate the dataset with data from XML file. If one of the values contains apostrophe (for instance: It's something) then an error occures: System.Xml.XmlException: Invalid character in the given encoding. Is this a bug or what? I wouldn't want to parse an XML created by another program which is using the same ADO.NET for creating the file. On that side apostrophe is allowed.
4 Answers
" Apostrophes are special characters in XML; you need to replace them with the string ' "
I'm desperately trying to write & apos ; instead of '; it didn't work and there's no way I found to edit (or preview, for that matter. Hopefully spaces will give the proper output.
Someone with better skills erase my shame...
Liz MacoveiPosted Aug 15, 2008, 3:54 AM EDT
" Apostrophes are special characters in XML; you need to replace them with the string ' "
I'm desperately trying to write & apos ; instead of '; it didn't work and there's no way I found to edit (or preview, for that matter. Hopefully spaces will give the proper output.
Someone with better skills erase my shame...
Liz MacoveiPosted Aug 15, 2008, 3:53 AM EDT
Apostrophes are special characters in XML; you need to replace them with the string ' (the same goes for <, >, &, ")
There is a method that does the replacing for you, but I don't remember what it's called or where to look for it; if I find it, I'll {edit|post}.
Liz MacoveiPosted Aug 15, 2008, 3:50 AM EDT
Apostrophes are special characters in XML; you need to replace them with the string ' (the same goes for <, >, &, ")
There is a method that does the replacing for you, but I don't remember what it's called or where to look for it; if I find it, I'll {edit|post}.
Liz MacoveiPosted Aug 15, 2008, 3:48 AM EDT

