易截截图软件、单文件、免安装、纯绿色、仅160KB

XML XQuery

--XQuery 基于现有的 XPath 查询语言,并支持更好的迭代、更好的排序结果以及构造必需的 XML 的功能。
--1.声明一个 xml 类型的变量,然后使用 xml 数据类型的 query() 方法来查询此变量
DECLARE @x xml
SET @x = '<ROOT><a>111</a></ROOT>'
SELECT @x.query('/ROOT/a')
--查找属性aid=20的a节点
DECLARE @x xml
SET @x = '<ROOT>
   <a aid="10">10</a>
   <a aid="20">20</a>
      </ROOT>'
SELECT @x.query('/ROOT/a[@aid=20]')
--2.询是针对 AdventureWorks 数据库中 ProductModel 表的 xml 类型的 Instructions 列指定的。
--查找条件ProductModelID=7,属性LocationID=10的Location节点
SELECT Instructions.query('declare namespace AWMI="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelManuInstructions";        
    /AWMI:root/AWMI:Location[@LocationID=10]
') as Result
from  Production.ProductModel
WHERE ProductModelID=7
--XQuery 包含命名空间声明(declare namespace AWMI=...)和查询表达式(/AWMI:root/AWMI:Location[@LocationID=10])。
DECLARE @x xml
SET @x = '<ROOT>
   <a aid="10">10</a>
   <a aid="20">20</a>
      </ROOT>'
SELECT @x.query('/ROOT/a[@aid=20]')


相关文档:

vim html xml 自动补全(在closetag.vim 上作了点修改)

当输入 》时自动补全 当输入《/时自动补全
“=================================
" File: closetag.vim
" Summary: Functions and mappings to close open HTML/XML tags
" Uses: <C-_> -- close matching open tag
" Author: Steven Mueller <di ......

xml选取单个节点内容解决办法

XPath 语法
2007-06-05 17:24
XPath 语法
作者:w3pop.com 翻译/整理:w3pop.com 发布:2007-04-29 浏览:674 :: ::
XPath Nodes(节点) XPath Axes
XPath uses path expressions to select nodes or node-sets in an XML document. The node is selected by following a path or steps.
XPath 通过路径表达式从XM ......

XML Schema 中 import 和 include 的区别

XML Schema 中 import 和 include 的区别
XML Schema 允许将一个XSD文件分为几个文件存放,在必要时使用 import 或者 include 进行导入。这二者的区别是:
import:只能导入不同命名空间的XSD
include:只能导入相同命名空间的XSD,或被导入的XSD未声明命名空间
例子:
<xsd:import namespace=”http://acme ......

.net中,读取XML在页面显示,布局用Repeater控件

 public static IList<News> GetAllNews()
        {
            XmlDocument xdoc = new XmlDocument();
            xdoc.Load("你读取的地址:例如 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号