[Mono-list] Differing behaviour of XmlDocument.Save(String) on Linux and Windows

Chris Raine c.raine@gmx.net
Wed, 16 Jun 2004 01:29:12 +0200

Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

On Wed, 2004-06-16 at 00:31, Atsushi Eno wrote:
> Hmm, this does not happen to my fedora core 2 box. It raises
> file sharing error. Which version of mono are you using?
the problem occured under mono 0.91 and disappeared under 0.95.
Sometimes I am a bit to cautious about updates.=20

> When you open a file via XmlTextReader, it is locked until you
> explicitly call Close(). Thus, the file sharing error should be
> thrown, since you are keeping the file opened.
> > (OT now, sorry) Does anyone know an elegant way of loading an
> > XmlDocument and then writing the updated contents back into the same
> > file?=20
> Once you read up the source xml into XmlDocument, the input file can
> be used (by calling Close()).

many thanks for that tip. I spent some time looking for some Close() or
FreeResources() method in XmlDocument, but that was obviously the wrong
place to look.=20

> > Next to the problem with XmlDocument, if I dump a DateTime Object to
> > string with ToString("F") on Linux and read that dumped string back
> > a windows box with DateTime.Parse(string) I get an FormatException.=20
> In which culture are you living? The line below will provide you the
> exact information.
> Console.WriteLine (System.Globalization.CultureInfo.CurrentCulture);
> We could not support all the culture and it may differ if IBM icu
> defines different culture data. Right now CultureInfo.InvariantCulture
> should work fine.

many, many thanks again for that tip. my rh9 box is running under en-US
and the winXP under de-DE, setting the
System.Threading.Thread.CurrentThread.CurrentCulture to
CultureInfo.InvariantCulture solved the problem.=20

again many thanks ...=20


Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

Version: GnuPG v1.2.1 (GNU/Linux)