摘要:
提高 LINQ to XML 中的性能的一种方法是预原子化 XName 对象。预原子化是指在通过使用 XElement 和 XAttribute 类的构造函数创建 XML 树之前,先将字符串分配给 XName 对象。然后传递初始化的 XName 对象,而不是将字符串传递给构造函数(此过程将使用从字符串到 XName 的隐式转换)。 XName Root = "Root"; XName Data =... 阅读全文
posted @ 2008-12-26 15:53
昕友软件开发
阅读(294)
评论(0)
推荐(0)
摘要:
string xslMarkup = @" "; XDocument xmlTree = new XDocument( ... 阅读全文
posted @ 2008-12-26 15:21
昕友软件开发
阅读(290)
评论(0)
推荐(0)
摘要:
XElement root = XElement.Load("Irregular.xml"); IEnumerable configParameters = root.Elements("Customer").Elements("Config"). Elements("ConfigParameter"); foreach (XElement cp in configParamet... 阅读全文
posted @ 2008-12-26 14:39
昕友软件开发
阅读(221)
评论(0)
推荐(0)
摘要:
//检索元素集合 XElement po = XElement.Load("c:/test.xml"); IEnumerable childElements = //from el in po.Descendants("Book") from el in po.Descendants("... 阅读全文
posted @ 2008-12-26 11:46
昕友软件开发
阅读(1127)
评论(0)
推荐(0)
摘要:
IEnumerable grandChildData = from el in StreamRootChildDoc(new StringReader(markup)) where (int)el.Attribute("Key") > 1 select (string)el.Element("Grand... 阅读全文
posted @ 2008-12-26 11:23
昕友软件开发
阅读(368)
评论(0)
推荐(0)
摘要:
XDocument d = new XDocument( new XComment("This is a comment."), new XProcessingInstruction("xml-stylesheet", "href='mystyle.css' title='Compact' type='text/css'"), new... 阅读全文
posted @ 2008-12-26 10:37
昕友软件开发
阅读(651)
评论(0)
推荐(0)
摘要:
XElement c = new XElement("Customers", new XElement("Customer", new XElement("Name", "John Doe"), new XElement("PhoneNumbers", new XElement("Phone", ... 阅读全文
posted @ 2008-12-26 10:03
昕友软件开发
阅读(283)
评论(0)
推荐(0)
摘要:
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml.Linq; namespace linq { class Program { static void Main(string[] args) { ... 阅读全文
posted @ 2008-12-26 10:00
昕友软件开发
阅读(407)
评论(0)
推荐(0)

浙公网安备 33010602011771号