[Mono-list] Mono 2.0 and XmlDocument.SelectSingleNode - XPath error

Gert Driesen gert.driesen at telenet.be
Tue Nov 4 17:14:10 EST 2008


Hi Bálint,

 

As expected, it works just fine here (using SVN HEAD).

 

I suggest to create a small self-contained test-app that shows the problem, and then submit a bug report with the repro added as attachment (not inline).

 

Gert

 

From: Bálint Kardos [mailto:kardosbalint at gmail.com] 
Sent: dinsdag 4 november 2008 22:43
To: Gert Driesen
Cc: mono-list at lists.ximian.com
Subject: Re: [Mono-list] Mono 2.0 and XmlDocument.SelectSingleNode - XPath error

 

Hi Gert,

 

the XML is nothing fancy:

 

<response> 

 <query>search</query>

 <totalresults>28705</totalresults> 

 <start>1</start>

 <end>10</end>

 <results>

            <result/> 

            <result/> 

 </results>

</response>

 

(result nodes have more data)

 

üdvözlettel
with regards

Kardos Bálint
_______________________________________
http://skaelede.hu 10 (0xA) év a magyar weben



On Tue, Nov 4, 2008 at 22:37, Gert Driesen <gert.driesen at telenet.be> wrote:

Bálint,

 

Please provide the XML file you're using.

 

Thanks,

 

Gert

 

From: mono-list-bounces at lists.ximian.com [mailto:mono-list-bounces at lists.ximian.com] On Behalf Of Bálint Kardos
Sent: dinsdag 4 november 2008 22:35
To: mono-list at lists.ximian.com
Subject: [Mono-list] Mono 2.0 and XmlDocument.SelectSingleNode - XPath error

 

Hi,

 

this is the 3rd mono-related error I found in one ~500 line web project of mine, and it's still not working :)

 

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. Why?

 

thanks,

 

b.


üdvözlettel
with regards

Kardos Bálint
_______________________________________
http://skaelede.hu 10 (0xA) év a magyar weben

No virus found in this incoming message.
Checked by AVG - http://www.avg.com
Version: 8.0.175 / Virus Database: 270.8.6/1765 - Release Date: 11/3/2008 4:59 PM

 

No virus found in this incoming message.
Checked by AVG - http://www.avg.com
Version: 8.0.175 / Virus Database: 270.8.6/1765 - Release Date: 11/3/2008 4:59 PM

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20081104/ebff632c/attachment.html 


More information about the Mono-list mailing list