[Mono-bugs] [Bug 343960] New: XPathException removing comment

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Nov 26 05:17:26 EST 2007


https://bugzilla.novell.com/show_bug.cgi?id=343960

           Summary: XPathException removing comment
           Product: Mono: Class Libraries
           Version: 1.2.6
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Sys.XML
        AssignedTo: atsushi at ximian.com
        ReportedBy: kobruleht2 at hot.ee
         QAContact: mono-bugs at ximian.com
          Found By: ---


To reproduce

Run the code

Observed:

System.Xml.XPath.XPathException: Current node is removed while it should not
be, or there are some bugs in the XPathNavigator implementation class:
Mono.Xml.XPath.XmlDocumentEditableNavigator
  at System.Xml.XPath.DescendantIterator.MoveNextCore () [0x00000] 
  at System.Xml.XPath.BaseIterator.MoveNext () [0x00000] 
  at System.Xml.XPath.AxisIterator.MoveNextCore () [0x00000] 
  at System.Xml.XPath.BaseIterator.MoveNext () [0x00000] 
  at System.Xml.XPath.SimpleSlashIterator.MoveNextCore () [0x00000] 
  at System.Xml.XPath.BaseIterator.MoveNext () [0x00000] 
  at System.Xml.XmlIteratorNodeList+XPathNodeIteratorNodeListIterator.MoveNext
() [0x00000] 
  at Test.Main () [0x00000] 

Environment:

1.2.6 charged preview 2
NET 2 profile
Windows XP
VCSE 2008


using System;
using System.Windows.Forms;
using System.Xml;

public class Test
{
    [STAThread]
    static void Main()
    {
        try
        {
            XmlDocument xDoc = new XmlDocument();
            xDoc.PreserveWhitespace = false;
            xDoc.LoadXml(xml);
            XmlNodeList list = xDoc.SelectNodes("//comment()");
            foreach (XmlNode node in list)
            {
                node.ParentNode.RemoveChild(node);
            }
        }
        catch (Exception ex)
        {
            Clipboard.SetText(ex.ToString());
            MessageBox.Show(ex.ToString());
        }
    }

    const string xml = @"<?xml version=""1.0"">
<Report><!-- --></Report>
    ";

}


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list