不挣扎了,开始学习LINQ TO XML,进而来解析网页。

找到了别人遇到和我一样的问题: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了。

 

转载于:https://www.cnblogs.com/yffswyf/p/4015570.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值