Please do not reply to this email- if you want to comment on the bug, go to the URL shown below and enter your comments there.
Changed by [EMAIL PROTECTED] http://bugzilla.ximian.com/show_bug.cgi?id=79874 --- shadow/79874 2006-11-09 09:11:39.000000000 -0500 +++ shadow/79874.tmp.28552 2006-11-09 09:11:39.000000000 -0500 @@ -0,0 +1,70 @@ +Bug#: 79874 +Product: Mono: Class Libraries +Version: unspecified +OS: unknown +OS Details: +Status: NEW +Resolution: +Severity: Unknown +Priority: Normal +Component: Sys.XML +AssignedTo: [EMAIL PROTECTED] +ReportedBy: [EMAIL PROTECTED] +QAContact: [EMAIL PROTECTED] +TargetMilestone: --- +URL: +Cc: +Summary: XPath query, unable to select element node + +Description of Problem: + +The XPath query "/Abc/Foo" over xml "<Abc><Foo>Hello</Foo></Abc>" does not +work on mono. This fails in cases where the node being selected does not +have any child nodes. + +Test case: + +using System; +using System.IO; +using System.Xml.XPath; +using System.Xml; + +namespace xpath +{ + class Program + { + static void Main (string [] args) + { + StringReader sr = new StringReader +(@"<Abc><Foo>Hello</Foo></Abc>"); + XPathDocument doc = new XPathDocument (sr); + XPathNavigator nav = doc.CreateNavigator (); + + XPathNodeIterator iter = nav.Select ("/Abc/Foo"); + Console.WriteLine (iter.Count); + iter.MoveNext (); + Console.WriteLine (iter.Current.InnerXml); + + } + } +} + +Actual Results: [EMAIL PROTECTED]:~/test/md$ mono one.exe +1 + +Unhandled Exception: System.InvalidOperationException: This XmlWriter does +not accept Text at this state Start. + at System.Xml.XmlTextWriter.ShiftStateContent (System.String occured, +Boolean allowAttribute) [0x00000] + at System.Xml.XmlTextWriter.WriteString (System.String text) [0x00000] + at System.Xml.XmlWriter.WriteNode (System.Xml.XmlReader reader, Boolean +defattr) [0x00000] + at System.Xml.XPath.XPathNavigator.get_InnerXml () [0x00000] + at xpath.Program.Main (System.String[] args) [0x00000] + + +Expected Results: + +1 +Hello _______________________________________________ mono-bugs maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-bugs
