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: [EMAIL PROTECTED]
ReportedBy: [EMAIL PROTECTED]
QAContact: [EMAIL PROTECTED]
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.
_______________________________________________
mono-bugs maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs