不挣扎了,开始学习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了。
不挣扎了,开始学习LINQ TO XML,进而来解析网页。的更多相关文章
- C#学习之Linq to Xml
前言 我相信很多从事.NET开发的,在.NET 3.5之前操作XML会比较麻烦,但是在此之后出现了Linq to Xml,而今天的主人公就是Linq to Xml,废话不多说,直接进入主题. 题外:最 ...
- LINQ to XML LINQ学习第一篇
LINQ to XML LINQ学习第一篇 1.LINQ to XML类 以下的代码演示了如何使用LINQ to XML来快速创建一个xml: public static void CreateDoc ...
- [开发笔记]-Linq to xml学习笔记
最近需要用到操作xml文档的方法,学习了一下linq to xml,特此记录. 测试代码: class Program { //参考: LINQ to XML 编程基础 - luckdv - 博客园 ...
- Linq学习<五> 运用linq查询Xml
这节将学习如何用 linq查询xml 一.我们先看看在xml中我们怎么操作 public void xmlWayToQueryXmlFile() { XmlDocument xmldoc = new ...
- Linq学习<四> linq to XML
LINQ to XML并不打算替代标准的XML API,例如,XML DOM(Document Object Model).Path.XQuery和XSLT等.如果熟悉这些API或当前需要使用或学习它 ...
- XML基础学习02<linq to xml>
Linq to XML的理解 1:这是一种比较好的操作Xml的工具. àXDocument 文档 àXElement 元素 àXAttribute 属性 àXText 文本 2:这里还是和我们之前创建 ...
- Linq学习笔记---Linq to Xml操作
LINQ to XML的成员, 属性列表: 属性 说明 Document 获取此 XObject 的 XDocument EmptySequence 获取空的元素集合 FirstAttribut ...
- linq to xml学习
http://www.cnblogs.com/greatverve/archive/2010/07/09/linq-to-xml-add-delete-update-query.html 记录一下,别 ...
- LINQ to XML学习笔记
一.XML基础知识 1.XML:可扩展标记语言 Extensible Markup Language ,提供了一种保存数据的格式,数据可以通过这种格式很容易地在不同的应用程序之间实现共享. 2.使用X ...
随机推荐
- Linux Running State Process ".so"、"code" Injection Technology
catalog . 引言 . 基于so文件劫持进行代码注入 . 基于函数符号表(PLT)中库函数入口地址的修改进行代码注入 . PLT redirection through shared objec ...
- Linux GDB Debugging
Catalog . GDB Introduction . GDB基本命令 1. GDB Introduction GDB是GNU开源组织发布的一个强大的UNIX下的程序调试工具,GDB主要可帮助工程师 ...
- Spring BeanUtils的用法
package test; import java.util.Date; import org.springframework.beans.BeanUtils; import test.basic.B ...
- linux安装Mac的默认Monaco字体
Monaco字体是我最喜欢的编程字体,如果你想在linux上面安装,只需要在terminal中执行: curl -kL https://raw.github.com/cstrap/monaco-fon ...
- Linux 下的常用工具
Useful Linux Utilities (This article is under constant construction) ssh 相关文章 How To Change OpenSSH ...
- How to set up an FTP server on Ubuntu 14.04
How to set up an FTP server on Ubuntu 14.04 Setting up a fully-functional and highly secure FTP serv ...
- Emgu学习之(四)——图像阈值
http://www.cnblogs.com/CoverCat/p/5043833.html Visual Studio Community 2015 工程和代码:http://pan.baidu.c ...
- BZOJ3226: [Sdoi2008]校门外的区间
感觉很有趣的题呢. 每个点拆成两个,线段树维护. 不过这题难点其实在输入输出. #include<bits/stdc++.h> #define N (1<<17) #defin ...
- 【原】javascript数组操作
继续我的第二遍<javascript高级程序设计第三版>,今天要做的笔记是array 一.数组的操作 1.数组的创建: var colors= new Array(); //创建一个数组 ...
- StringBuilder 和 StringBuffer
这两者唯一的不同就在于,StringBuffer是线程安全的,而StringBuilder不是.当然线程安全是有成本的,影响性能,而字符串对象及操作,大部分情况下,没有线程安全的问题,适合使用Stri ...