Linked Questions
13 questions linked to/from Best way to encode text data for XML
6 votes
3 answers
16k views
Embedding an xml document inside an xml string [duplicate]
I have a web service that returns an xml string as results. The return string is in this format: <ReturnValue> <ErrorNumber>0 </ErrorNumber> <Message>my message</Message&...
0 votes
1 answer
189 views
How to prepare a string with foreign / accented characters for XML in C#? [duplicate]
I would like to transform a string like this "¿Cómo puede hacerse esto?" Into something that can be used within an XML resx file like this: "¿Cómo puede hacerse esto?" I have tried ...
106 votes
21 answers
225k views
Best way to encode text data for XML in Java?
Very similar to this question, except for Java. What is the recommended way of encoding strings for an XML output in Java. The strings might contain characters like "&", "<", etc.
11 votes
5 answers
14k views
Unescaping XML entities using XmlReader in .NET?
I'm trying to unescape XML entities in a string in .NET (C#), but I don't seem to get it to work correctly. For example, if I have the string AT&T, it should be translated to AT&T. One ...
5 votes
4 answers
17k views
Escaping new-line characters with XmlDocument
My application generates XML using XmlDocument. Some of the data contains newline and carriage return characters. When text is assigned to an XmlElement like this: e.InnerText = "Hello\nThere"; ...
2 votes
3 answers
6k views
XmlElement with special character in innertext
In my c# application i am creating an xml based on the database value. It woks fine until the string is not a special character. Below is my code. XmlDocument doc = new XmlDocument(); XmlElement ...
0 votes
2 answers
7k views
How to include encoding when creating xml files
I want to create an XML file to store information. I am using the following code. I would like to know how to specify the encoding for this file in code. When I try to read this file in another form ...
1 vote
3 answers
4k views
Strip Out Illegal Characters For Excel Sheet
I wrote a program to crawl website to get data and output to a excel sheet. The program is written in C# using Microsoft Visual Studio 2010. For most of the time, I have no problem getting content ...
2 votes
3 answers
935 views
Is there any built-in function in NET Framework which encodes a string to a valid XML unicode?
After checking an Xps file i noticed that the string within the Xps file <> is converted to <> So is there any built-in function in the .Net framework that could do this job for ...
0 votes
3 answers
459 views
How to add ASCII command like " " to XmlNode innerText?
I'm trying to add the ASCII carriage return to the end of a string in an XmlNode's InnerText like this: XmlNode spanNode = doc.CreateElement("span"); spanNode.InnerText = "carriage return ...
0 votes
1 answer
199 views
How to convert a formula to a valid identity name in C#?
In an application, I have to use a valid identity string as a value of a property. I mean the string should be a valid identity name in C#. For I want to use the string as a formula without change ...
0 votes
2 answers
52 views
is it normal to send special characters encoded in post
I had a discussion with someone and could not come to a proper solution so I wanted to know how you guys think about this: I have a html form and the other guy call him 'Aron' has got a .net system. ...
0 votes
1 answer
49 views
Encode all XML tags in a string
I got the codes below to encode XML content in String. It's working fine to encode a single tag, but not all the tags within. String a = @"<main>" + "<Title title=\"Hello & &...