Hi,
I'm sure there's something embedded in the .NET framework to do this, but I just can't seem to find it.
I've got a string variable that contains xml text
e.g. <tag>data</tag>
I load this string into an XmlDocument using
xmlDoc.Load(New StringReader("<tag>data</tag>"))
Which all works fine when the text "data" doesn't contain '&', '<', '>' etc.
What I'm after is a .NET function that will either correctly convert the data items in my string prior to loading into the XmlDocument object or a function that handles the string 'warts and all' and creates the XmlDocument correctly.
Currently I'm having to parse the text by hand to find the characters and replace them.
Hope that all makes sense.