【发布时间】:2012-03-13 03:53:13
【问题描述】:
听到的是 XML。我正在尝试获取 作者 在 2012 年 15 月 2 日至 2012 年 2 月 24 日 的日期范围内发布的标题数量从高到低(标题数量)。
<entries>
<entry>
<id>1</id>
<published>23/02/2012</published>
<title>Title 1</title>
<content type="html">This is title one</content>
<author>
<name>Pankaj</name>
</author>
</entry>
<entry>
<id>2</id>
<published>22/02/2012</published>
<title>Title 2</title>
<content type="html">This is title two</content>
<author>
<name>Pankaj</name>
</author>
</entry>
<entry>
<id>3</id>
<published>21/02/2012</published>
<title>Title 3</title>
<content type="html">This is title three</content>
<author>
<name>Rob</name>
</author>
</entry>
<entry>
<id>4</id>
<published>20/02/2012</published>
<title>Title 4</title>
<content type="html">This is title four</content>
<author>
<name>Bob</name>
</author>
</entry>
<entry>
<id>5</id>
<published>19/02/2012</published>
<title>Title 1</title>
<content type="html">This is title five</content>
<author>
<name>Pankaj</name>
</author>
</entry>
我正在尝试从 xquery 获取输出:
<?xml version="1.0" encoding="UTF-8"?>
<results>
<result>
<author>
<name>Pankaj</name>
</author>
<numberOfTitles>3</numberOfTitles>
</result>
<result>
<author>
<name>Rob</name>
</author>
<numberOfTitles>1</numberOfTitles>
</result>
<result>
<author>
<name>Bob</name>
</author>
<numberOfTitles>1</numberOfTitles>
</result>
请帮帮我..
【问题讨论】:
-
这可能取决于您使用的 XQuery 版本。应该使用什么 XQuery 处理器/数据库来运行该查询?
-
我正在使用氧气 (Saxon-PE Xquery9.2.0.6) 进行开发。最后我必须通过 Marklogic 上的 XCC api 运行这个查询。