在.Net1.2中对Xquery的支持
来源:互联网 发布:邪恶爱之知可知子伯母 编辑:程序博客网 时间:2024/05/18 01:56
using System;using System.IO;using System.Xml;using System.Xml.Query;using System.Data.SqlXml;namespace Xquery{public class XquerySample{ public static void Main(string[] args) { System.Xml.XmlDataSourceResolver ds = new System.Xml.XmlDataSourceResolver (); ds.Add("bookstore","books.xml"); StreamWriter writer=new StreamWriter("output.xml"); string query=@"<bookstore> { for $b in document('bookstore')/bookstore/book where $b/@genre='philosophy' and $b/@publicationdate='1991' return $b/title } </bookstore>"; XqueryProcessor xp = new XqueryProcessor (); xp.Compile(query); xp.Execute(ds, writer); writer.Close(); } }}
books.xml
<?xml version="1.0" encoding="utf-8"?><!-- This file represents a fragment of a bookstore database --><bookstore> <book genre="autobiography" publicationdate="1981" ISBN="1-861-11-0"> <title>The Autobiography of Benjamin Franklin</title> <author> <first-name>Benjamin</first-name> <last-name>Franklin</last-name> </author> <price>8.99</price> </book> <book genre="novel" publicationdate="1967" ISBN="0-201-63361-2"> <title>The Confidence Man</title> <author> <first-name>Herman</first-name> <last-name>Melville</last-name> </author> <price>11.99</price> </book> <book genre="philosophy" publicationdate="1991" ISBN="1-861001-57-6"> <title>The Gorgias</title> <author> <name>Plato</name> </author> <price>9.99</price> </book></bookstore>
output.xml<?xml version="1.0" encoding="utf-8"?><bookstore><title>The Gorgias</title></bookstore>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>- 在.Net1.2中对Xquery的支持
- 在.Net1.2中对Xquery的支持
- --切分(Split),使用SQL Server 2005对XQuery的支持:
- 微软在今年11月份发布的SQL Server 2005中支持XQuery和本地 XML数据类型
- XQuery 对 XPath 的扩展
- 在XQuery中使用Module
- Spring.NET1.2+Nhiberate1.2在使用GridView中碰到的几个问题
- 在Java中应用Saxon实现Xquery
- 在asp.net1.1中执行应用程序
- 怎样在Linux中加入对NTFS的支持?
- 如何在程序中加入对vbscript的支持
- 在Windows CE 6.0中添加对MFC的支持
- 在 Silverlight 应用程序中实现对 FLV 视频格式的支持
- 在内核中增加对yaffs文件系统的支持
- 在驱动中增加对udev的支持
- 在内核中增加对yaffs文件系统的支持
- 在SourceInsight中加入对.S文件的支持
- 在StageFright中增加对FLV的支持
- 第十四章 数组[《.net框架程序设计》读书笔记]
- 限制输入次数的系统登陆的实现
- .net的MSMQ异步调用
- 手工修改动网新闻.net3.0的Bug
- 第九章 方法[《.net框架程序设计》读书笔记]
- 在.Net1.2中对Xquery的支持
- ASP.NET应用程序资源访问安全模型
- 三百年前的四川与重庆:上万只华南虎下山吃人
- 使用Ado.net获取数据库架构信息
- 国外开源.Net 系统概述
- VB.net基础:如何获得并显示网上图片
- VB与Excel在乘幂运算时的结果差异及其不合理性
- 在HTM中引用VB6的OCX控件
- 在气泡式提示窗口中显示关闭按钮和链接。