Link to home
Start Free TrialLog in
Avatar of rp
rpFlag for Portugal

asked on

Error when load xml from text box with special characters


I have this code to generate/formatting xml from content of a text box:

  Dim xmlDoc As New XmlDocument
  xmlDoc.LoadXml(Textbox)   Dim writer As New XmlTextWriter("C:\Work\xmlWriterTest.xml", Nothing)   writer.Formatting = Formatting.Indented   xmlDoc.Save(writer)

Open in new window

It works well, but when i have for example a special character like (&) character i get an erro in LoadXml.

How can handle with this error or change encoding?

best regards

Avatar of David H.H.Lee
David H.H.Lee
Flag of Malaysia image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial