[Mono-list] Possible bug in XmlDocument
Daniel Pecos
dpecos_listas@yahoo.es
Tue, 1 Apr 2003 22:48:40 +0200
--UHN/qo2QbUvPLonB
Content-Type: multipart/mixed; boundary="envbJBWh7q8WU6mo"
Content-Disposition: inline
--envbJBWh7q8WU6mo
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Hello!
I think I've found a bug in function RemoveChild from
XmlNode. I don't know if it really is a bug because i hadn't
enough time to test it on ms .net.
The problem happens when you delete the las child node of a node
that has more than one child (i've test with 3), and then you
try to save it contents.
=09
The sources of the example are attached.
Bye!
--=20
=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=
=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7
=B7 .--. _ =B7
=B7 |o_o | Daniel Pecos Mart=EDnez / \ =B7
=B7 |:_/ | IRC Name: zeyen | () | =B7
=B7 // \ \ | \_/ =B7
=B7 (| | ) Web: www.netpecos.org \ =B7
=B7 /'\_ _/`\ \ =B7
=B7 \___)=3D(___/ Linux User: #175518 debian =B7
=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=
=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7
only available on a need to know basis
--envbJBWh7q8WU6mo
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="prueba.cs"
Content-Transfer-Encoding: quoted-printable
using System;
using System.Xml;
namespace p {
class test {
public static void Main (string [] args) {
XmlDocument a =3D new XmlDocument();
a.Load("test.xml");
XmlNode n1 =3D a.FirstChild;
XmlNode n2 =3D n1.FirstChild.NextSibling.NextSibling;
n1.RemoveChild(n2);
=09
a.Save(Console.Out);
}
}
}
=09
--envbJBWh7q8WU6mo
Content-Type: text/xml; charset=us-ascii
Content-Disposition: attachment; filename="test.xml"
<test>
<h1>h1</h1>
<h2>h1</h2>
<h3>h1</h3>
</test>
--envbJBWh7q8WU6mo--
--UHN/qo2QbUvPLonB
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
iD8DBQE+ifsovzta/NRIDmARAkoYAJoDUcrXNCuyDnn0YPChrHDujUzf5wCfY2gj
v+HSYabIbAG+OnNIaJ9kP74=
=5W2b
-----END PGP SIGNATURE-----
--UHN/qo2QbUvPLonB--