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]')
相关文档:
问题描述:
jboss应用服务器,使用spring
无法启动服务,错误日志:
[org.apache.xerces.jaxp.DocumentBuilderFactoryImpl@155d3a3] does not
support XML Schema. Are you running on Java 1.4 or below with Apache
Crimson? Upgrade to Apache Xerces (or Java 1.5) for full XSD ......
1:如何通过socket代理来访问服务端:
String proxyHost =
"192.168.204.212"
;
String proxyPort =
"1080"
;
//通知Java要通过代理进行连接。
正在装载数据……
System.get ......
在Perl中解析XML的方法最常见的就是使用 XML::DOM
和 XML::Simple了。
XML::DOM过于庞大,而且解析结果是一个DOM树,操作也不方便。
对于小型且不复杂的XML文件,XML::DOM真是杀鸡用牛刀。
这时就轮到轻便的XML::Simple上场了。
XML::Simple如其名,真的很简单。假设XML内容如下:
<opt>
<user login= ......
创建XML文件:
public boolean createXML(){
try{
Document doc = DocumentHelper.createDocument();
Element root = doc.addElement("root");
Element personNode = root.addElement("person");
Element sonNode = personNode ......
把xml拖到IE里就找到错在哪里了
如下:
The XML page cannot be displayed
Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.
文档的顶层无效。处理资源 'file:///D:/Tomcat 5.5/webapps/myapp/WEB-INF/web.xml' 时出错。第 1 行,位置: 44 ......