Hi mas_oz2003.. attached the xml.
second xml text has rendered register mark. but i dont need that since it just saves the file.
Main Topics
Browse All TopicsI'm having an issue with special characters being replaced by some different characters in the xml document.
For example is "®" comes out as "®".
XmlDocument document = new XmlDocument();
document.Load("C:\test.xml
document.Save("C:\test2.xm
<?xml version="1.0" encoding="UTF-8"?>
I checked the encoding. both has same encoding text. But when I save test2.xml, it has some characters in root
<?xml version="1.0" encoding="UTF-8"?>
How to handle this...
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Ok. this is the issue: &# is a special construct in xml files:
U+00AE ® c2 ae REGISTERED SIGN
This is the reason that when you saved, the string(®) is being translated to its equivalent unicode value.
Check:
http://www.opentag.com/xfa
how to handle it
Include your special characters(eg. ®) in CDATA section. see:
http://www.w3schools.com/X
so that all special characters will be ignored by the parser.
or open the file as text and manipulate its contents as text. (Not pretty but it seems to be the only way to do it)
By the way what version of .net are you using?
something that you can try is to use xsl transforms when merging your xmls:
http://msdn.microsoft.com/
(See the end of first question.)
if it does not work my previous post still holds
Business Accounts
Answer for Membership
by: mas_oz2003Posted on 2009-11-03 at 18:20:52ID: 25735855
Can you post your file?
I tried to check that the original file does not come from a different encoding.
If you open the original file in notepad, can you see the character changes?