Problem with modifying XML File

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hey everyone,
Im reading a Apple plist file (Its a xml file) using XmlDocument class and modifying certain nodes. After I finish processing, I save the xml file using XmlDocument.Save(String fileName) method.
Everything is working fine except that Save method is appending [] in the DOCTYPE declaration.
For example original file looks like this
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd
And After I save my changes it looks like following.
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"[]>
notice the [] at the end.
Ive tried using XmlDocument.WriteTo(XmlWriter w) method as well but the behavior is same.<br/>
It seems Im not the only one with this problem. Someone else is having the same problem.
http://bytes.com/topic/c-sharp/answers/828060-xmldocument-save-bug-appending-doctype
Can anyone please tell what Im doing wrong.


View the full article
 
Back
Top