[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


--=-jOH2kF38YDlMoZhY8To+
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?
>=20
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.
>=20
> > (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
>=20
> Once you read up the source xml into XmlDocument, the input file can
> be used (by calling Close()).
>=20

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
a
> > string with ToString("F") on Linux and read that dumped string back
into
> > a windows box with DateTime.Parse(string) I get an FormatException.=20
>=20
> In which culture are you living? The line below will provide you the
> exact information.
>=20
> Console.WriteLine (System.Globalization.CultureInfo.CurrentCulture);
>=20
> 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.
>=20

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


regards,=20
chris=20




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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQBAz4ZIbYsg67DxFJcRAvMuAJ44X4lIpEzbqDRzqE7/DDGu3r8UFwCcCXps
7UkQQNJd24KNSkdzMM9D/pQ=
=/Or+
-----END PGP SIGNATURE-----

--=-jOH2kF38YDlMoZhY8To+--