不掙紮了,開始學習LINQ TO XML,進而來解析網頁。

來源:互聯網
上載者:User

標籤:http   io   os   使用   ar   for   sp   問題   on   

找到了別人遇到和我一樣的問題:http://ylad.codeplex.com/discussions/430095(英文)

一位叫做Mister Goodcat的提供了資訊:

Short answer: XPath is not supported on the phone. If you want to use HTML Agility Pack, use the LinqToXml features instead.

Long version: 
Enabling the XPath features on Windows Phone only works, as you stated, when you add a reference to the System.Xml.XPath assembly of the Silverlight 4 SDK. This is considered an unsupported workaround to add XPath support to Windows Phone which worked in the past on 7.x (also note the warning you receive in Visual Studio when you add the reference, about unexpected behavior). In Windows Phone 8, this trick doesn‘t seem to work anymore (see also Mathias comment here, for example). 
Apparently there now is a System.Xml.XPath assembly (version 4.0.0.0, as opposed to version 2.0.5.0 from the Silverlight SDK) that is internally used by the XAML page loader. Now when you add the Silverlight SDK version the result is a conflict between these involved assemblies that cannot be resolved.

是因為System.Xml.XPath 衝突了。並建議在使用HTML Agility Pack時不要使用System.Xml.XPath,而可用LinqToXml替代。

而且HTML Agility Pack在WP8  WP8.1上也缺少方法,導致不能使用Xpath來解析

所以不掙紮了,現在開始要學習LINQ TO XML了。

 

不掙紮了,開始學習LINQ TO XML,進而來解析網頁。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.