Click here to Skip to main content
15,891,837 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have xml file with special character, & < > " '

When I read XML file into data table it displays information in correct format.
i.e & < > " ' is replaced by & < > " '

When I do add new row and write data table back to XML , special characters
& < > replaced by & < > get , but " ' not replaced by " and '.

when I write data table to XML, How to replace special character " ' by " and ' ?


Thanks,
Somnath.
Posted
Comments
Zoltán Zörgő 31-Aug-12 2:04am    
Sorry, but review your post for correct encoding. Use html encoded characters: http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references
Andreas Gieriet 1-Sep-12 16:27pm    
That's mean! You seem to struggle with HTML encoding in your question: HTML is (kind of) XML. Change at the right places & by &amp;xxx;, e.g. &amp;quot; so that you get &quot;.
Please edit your question such that we know what conversion you struggle with.
Cheers
Andi

1 solution

I would say it's ok as it is.
Or do you have any issues with some consumers of your XML data?
The special character entities &apos; and &quot; only are relevant within attribute values. Otherwise, the plain " and ' can be used.
Cheers
Andi
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900