all groups > dotnet xml > july 2005 >
You're in the

dotnet xml

group:

Can't load xml containing \v



Can't load xml containing \v Harry Keck
7/27/2005 2:35:03 PM
dotnet xml: I have an xml document that I am trying to load, which contains RTF text. I
get the error, "{"'\v', hexadecimal value 0x0B, is an invalid character. Line
1, position 24." }" when I call this code.

System.Xml.XmlDocument xmlNewDocument = new System.Xml.XmlDocument();
xmlNewDocument.LoadXml("<TextExpanderPlainText>\v</TextExpanderPlainText>");

This loads without any errors in IE, but not .Net XML. Is there anything I
can do to get the xml string to load not knowing if it may contain any
Re: Can't load xml containing \v Bjoern Hoehrmann
7/28/2005 12:00:00 AM
* Harry Keck wrote in microsoft.public.dotnet.xml:
[quoted text, click to view]

Not really, you would need to remove the U+000B before passing the data
to the XML processor, the character is not allowed in XML documents and
XML processors must not recover from such errors. You might be able to
use a simple string replacement function for this task. Note that there
are other characters which are also not allowed, U+0000 for example. See
http://www.w3.org/TR/REC-xml for a complete list.
--
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
AddThis Social Bookmark Button