[Mono-bugs] [Bug 442102] New: XmlDocument.SelectSingleNode - XPath error
bugzilla_noreply at novell.com
bugzilla_noreply at novell.com
Wed Nov 5 18:24:24 EST 2008
https://bugzilla.novell.com/show_bug.cgi?id=442102
Summary: XmlDocument.SelectSingleNode - XPath error
Product: Mono: Runtime
Version: 2.0
Platform: Other
OS/Version: All
Status: NEW
Severity: Major
Priority: P5 - None
Component: generics
AssignedTo: mono-bugs at lists.ximian.com
ReportedBy: kardosbalint at gmail.com
QAContact: mono-bugs at lists.ximian.com
Found By: Community User
I have a well-formatted xml file, and i'm loading it into an XmlDocument:
XmlDocument _x = new XmlDocument();
_x.LoadXml(xml);
on Ms.net 2.0/3.5, it's working like this:
string _total = _x.SelectSingleNode("/response/totalresults").InnerText;
on Mono, I needed to write a workaround:
XmlNode total = _x.SelectSingleNode("//totalresults");
string _total = total.InnerText;
on Mono, SelectSingleNode simply returns null if it gets a full xpath, but
works if it's a global search pattern.
The XML:
<response>
<query>search</query>
<totalresults>28705</totalresults>
<start>1</start>
<end>10</end>
<results>
<result/>
<result/>
</results>
</response>
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
More information about the mono-bugs
mailing list