It looks like XmlDocumentNavigator wasn't handling the xml declaration node correctly. I have checked the following simple patch into cvs:
Index: XmlDocumentNavigator.cs
===================================================================
RCS file: /cvs/public/mcs/class/System.XML/System.Xml/XmlDocumentNavigator.cs,v
retrieving revision 1.4
diff -u -r1.4 XmlDocumentNavigator.cs
--- XmlDocumentNavigator.cs 13 Sep 2002 02:15:40 -0000 1.4
+++ XmlDocumentNavigator.cs 26 Oct 2002 22:25:28 -0000
@@ -123,7 +123,7 @@
case XmlNodeType.ProcessingInstruction:
return XPathNodeType.ProcessingInstruction;
}
- throw new InvalidOperationException ();
+ return (XPathNodeType) (-1);
}
}
Piers.
> -----Original Message-----
> From: Jaroslaw Kowalski [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, October 26, 2002 2:11 PM
> To: [EMAIL PROTECTED]
> Subject: [Mono-list] System.Xml bug
>
>
> Hi all!
>
> Looks like there's been some regression in System.Xml
> classes: Consider the (kind of trivial) code in xmlbug.cs
> (attached) and test.xml (also attached)
>
> On .NET it runs ok. On Mono, it produces:
> ========
> Unhandled Exception: System.InvalidOperationException: The
> requested operation cannot be performed in <0x000b1> 00
> System.Xml.XmlDocumentNavigator:get_NodeType () in <0x00020>
> 00 System.Xml.XPath.NodeNameTest:Match
> (System.Xml.Xsl.XsltContext,System.Xml.XPath.XPathNavigator)
> in <0x00034> 00 System.Xml.XPath.AxisIterator:MoveNext ()
> in <0x0001a> 00 System.Xml.XPath.SlashIterator:MoveNext ()
> in <0x0010e> 00 System.Xml.XmlNode:SelectNodes
> (string,System.Xml.XmlNamespaceManager)
> in <0x0006d> 00 .Bug1:Main (string[])
> ========
>
> I found that the problem is related to innocent '<?xml
> version="1.0" ?>' at the top of 'test.xml'. If I remove it,
> everything is OK. I'm 100% sure that it used to work properly
> on mono but is broken for some time now.
>
> Regards,
>
> Jarek
>
