I’ve just started learning c# in earnest and have developed a basic program to help things at work. What the program does is simply parse specific text snippets from an xml file and then pastes that snippet into a text box, in the program selected process.
At the moment the biggest issue is that there are a lot of accented and other special characters that I have to escape in the xml in order for the program to run properly.
My question would be, is there are way to bypass the whole escaping shenanigans? I’ve found that some of the text snippets in the xml have become quite unmanageable because of that, i.e. when I need to paste in html code etc.
Like I said, I’ve just started out so please excuse me if I used the wrong terms and let me know if you need any clarification on any of this.
If I understand you correctly, you’re asking if you can prevent this:
The only way I know is to use CDATA tags:
Hope this helps. It’s not exactly clean as a user can now pass anything via XML and you won’t be able to validate it with the XSD for the outer XML.