sql
php
iphone
css
c
python
database
linux
android
visual-studio
multithreading
eclipse
flash
html5
facebook
cocoa
mvc
php5
asp
postgresql
Can you check the encodings of the files you read and how it is written it might be byte order mark that makes the xmlwriter go nuts
We figured it out: Mono doesn't play well with whitespace, apparently, so doing this:
d = XDocument.Load(s, LoadOptions.None);
instead of this
d = XDocument.Load(s, LoadOptions.PreserveWhitespace);
will let it save properly.
I was able to find out an another workaround while preserving whitespaces. It is evident that Mono fails to save XDocument that was opened using LoadOptions.PreserveWhitespace. It seems to be a bug in Mono runtime implementation. Because, I didn't encounter any issues in MS CLR implementation on Windows platform.
The workaround is as below: (Here, you can still using LoadOptions.PreserveWhitespace in XDocument.Load method)
d.Root.Save(Values[key.ToLower()].SourceFile);
Instead of using
d.Save(Values[key.ToLower()].SourceFile);
It works well for me using Mono JIT compiler version 2.10.5 on Ubuntu 11.10 platform.