查找多个xml文件

chon81 2004-04-07 03:40:43
有什么方法可以同时查找多个XML文件。
好像可以用XQL,我不知道怎么用这东西,有人知道能不能说一下。
最好有XQL的例子。
...全文
64 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
lang11zi 2004-04-10
  • 打赏
  • 举报
回复
up
snowcloud2002 2004-04-10
  • 打赏
  • 举报
回复
不是XQL是XQuery

其实就是使用XPath

你可以看一下XMLSDK4.0里面有完整的XPath介绍
chon81 2004-04-10
  • 打赏
  • 举报
回复
怎么用XQL没有人知道吗.
chon81 2004-04-09
  • 打赏
  • 举报
回复
难道就没有人知道了吗?
chon81 2004-04-08
  • 打赏
  • 举报
回复
楼上的,不好意思,问个菜点的问题

你那些东西,我也看到过,我也在W3C网站上到很多例子.
可能是我英文不大好.我没找到怎么用你写的那些东西.

能告诉我怎么用你的那些东西去查询啊.
大可山人 2004-04-07
  • 打赏
  • 举报
回复
<bookstore>
{ for $b in document('bookstore')/bookstore/book
where $b/@genre='philosophy' and $b/@publicationdate='1991'
return $b/title }
{ for $b2 in document('bookstore2')/bookstore/book
where $b2/@genre='philosophy' and $b2/@publicationdate='2002'
return $b2/title }
</bookstore>
大可山人 2004-04-07
  • 打赏
  • 举报
回复
3.9 Unordered Expressions
In general, XQuery expressions return sequences that have a well-defined order. For example, the result of an axis step in a path expression is always returned in document order. Similarly, the result of a FLWOR expression is ordered by its order by clause and/or the expressions in its for clauses. However, in some expressions, the order of the result may not be significant to the user. In such an expression, one ordering may be much more efficient to materialize than another, and a significant performance advantage may be realized by allowing the system to materialize the results of the expression in the order it finds most efficient. XQuery provides a function named fn:unordered for this purpose.

The fn:unordered function takes any sequence of items as its argument, and returns the same sequence of items in a nondeterministic order. A call to the fn:unordered function may be thought of as giving permission for the argument expression to be materialized in whatever order the system finds most efficient. The fn:unordered function may be applied to the result of a query or to a subexpression inside a query.

The use of the fn:unordered function is illustrated by the following example, which joins together two documents named parts.xml and suppliers.xml. The example returns the part numbers of red parts, paired with the supplier numbers of suppliers who supply these parts. If the fn:unordered function were not used, the resulting list of (part number, supplier number) pairs would be required to have an ordering that is controlled primarily by the document order of parts.xml and secondarily by the document order of suppliers.xml. However, this might not be the most efficient way to process the query if the ordering of the result is not important. An XQuery implementation might be able to process the query more efficiently by using an index to find the red parts, or by using suppliers.xml rather than parts.xml to control the primary ordering of the result. The fn:unordered function gives the query evaluator freedom to make these kinds of optimizations.

fn:unordered(
for $p in fn:doc("parts.xml")//part[color = "Red"],
$s in fn:doc("suppliers.xml")//supplier
where $p/suppno = $s/suppno
return
<ps>
{ $p/partno, $s/suppno }
</ps>
)

8,906

社区成员

发帖
与我相关
我的任务
社区描述
XML/XSL相关问题讨论专区
社区管理员
  • XML/XSL社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧