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.
        
        The sources of the example are attached.

        Bye!
-- 
  �������������������������������������������������
  �     .--.                                 _    �
  �    |o_o |     Daniel Pecos Mart�nez    /   \  �
  �    |:_/ |     IRC Name: zeyen         |  () | �
  �   //   \ \                            |  \_/  �
  �  (|     | )   Web: www.netpecos.org    \      �
  � /'\_   _/`\                              \    �
  � \___)=(___/   Linux User: #175518     debian  �
  �������������������������������������������������

only available on a need to know basis
using System;
using System.Xml;

namespace p {
        class test {
                public static void Main (string [] args) {
                        XmlDocument a = new XmlDocument();
                        a.Load("test.xml");
                        XmlNode n1 = a.FirstChild;
                        XmlNode n2 = n1.FirstChild.NextSibling.NextSibling;
                        n1.RemoveChild(n2);
                        
                        a.Save(Console.Out);
                }
        }
}
                        
<test>
  <h1>h1</h1>
  <h2>h1</h2>
  <h3>h1</h3>
</test>

Attachment: pgp00000.pgp
Description: PGP signature

Reply via email to