Link to home
Start Free TrialLog in
Avatar of Peter Kiers
Peter KiersFlag for Netherlands

asked on

Using xml in my c# application

Hi,

I have this:

            "<Node Id=" + "3" + " ParentId=" + "1" + ">" + "\r\n" +
 
I use this line above to display it in a textbox.
Only I need to display the " too
(I don't know how you call " in english)
So it has to be something like this:

""3"" but with this I get an error.

How can i display the "-sing in my textbox.

I hope I have explain this right. My English isn't very well.

Peter
Avatar of strickdd
strickdd
Flag of United States of America image

&quot; instead of the " to escape it in XML
Avatar of Peter Kiers

ASKER

Don't understand what you mean. Can you give me an example

Peter
"&quot;3&quot;"
??? when i do that i get displayed in the textbox:



<Node Id=&quot;3&quot; ParentId=1>

and it should be

<Node Id="3" + ParentId="1">
ASKER CERTIFIED SOLUTION
Avatar of Ariful Ambia
Ariful Ambia
Flag of Bangladesh image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
With this I get an error:
"<Node Id=" + ""3"" <================
so when you write it to the textbox, either do a .Replace("&quot;", "\"") or HTMLEncode(myXML)
This works for me:

"<Node Id=" + doubleQuote + 3 + doubleQuote  etc...

Thanks.

500 points goes to NomanBD

Greetings,

Peter Kiers
Please review this: http://www.hdfgroup.org/HDF5/XML/xml_escape_chars.htm

Note the escape characters. To put these in XML, you have to escape them as specified and then un-escape them when you use them.