Hi,
I have inherited some ASP.net code which takes text from textboxes and reads it in to a DB as XML.
Everything is fine when the text is "clean". However, if I insert " " intot he text box, I get the following error:
Reference to undeclared entity 'nbsp'.
After some searching on the web I get the following post which seems to be very helpful -
http://blogs.pingpoet.com/overflow/archive/2005/07/20/6607.aspxHowever, this is well beyond my technical level and I can't really understand what to do!!
This is what I have:
Dim aArticleContentDoc As New XmlDocument
aArticleContentDoc.LoadXml
(articleCo
ntent) ---- and this is where the crash happens
articleContent in the test that crashes = <userxml><title></title><h
tml>Test&n
bsp; 1</html></userxml>
strangely, other things like & work fine.
What I need I think is either:
a) turn off whatever is causing the crash!
b) clean up the input
c) fix it properly!!
for b) I could simply so a replace on all which would fix this, but I don't know if it would happen again with something else (eg &ooops; breaks it too!)
Any help greatly appreciated.
Am running vb.net
Thanks
Andrew
Start Free Trial