eXist DB 和 Xquery:xincludes 或集合 (TEI-XML)? [英] eXist DB and Xquery : xincludes or collections (TEI-XML)?

查看:17
本文介绍了eXist DB 和 Xquery:xincludes 或集合 (TEI-XML)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 TEI-XML 语料库,它使用一个主"语料库 XML 文档,然后通过 xi:include 包含数千个其他文档.这些文档中的每一个本身都包含 xi:include 来主控命名实体(由 xml:id s 链接的人、地点等)列表.所有这些在 XSLT 中都非常有效(在我的 IDE Oxygen 中用于快速编码).

I have a corpus in TEI-XML which uses a 'master' corpus XML document that then contains, via xi:include, thousands of other documents. Each of these documents themselves contain xi:includes to master lists of named entities (people, places, etc linked by xml:ids) . All of this works very well in XSLT (and in my IDE Oxygen for fast encoding).

我现在开始使用 eXist-DB 应用程序构建网站.我直接在 Xquery 中重写所有内容(以替换 XSLT),并且我做出了一个意想不到的决定.我习惯于使用 xi:includes 来遍历语料库和各种 XML 文件.但是阅读 eXist DB 的文档,似乎鼓励的做法是使用集合并直接查询它们,而不是通过 xi:include 进行导航.eXist-DB 似乎也不支持 xi:includes 的完整实现,需要一些变通方法?

I am now embarking on building a website using eXist-DB applications. I am rewriting everything directly in Xquery (to replace XSLT), and I have hit upon an unexpected decision. I am used to using xi:includes to traverse the corpus and the various XMLs files. But reading the documentation of eXist DB, it seems that the encouraged practice is to use collections and query them directly, instead of navigating via xi:includes. It also seems that eXist-DB does not support the full implementation of xi:includes anyway and requires some work arounds?

我正在寻找有关在此上下文中 eXist-DB/Xquery 最佳实践的指导.

I am looking for guidance as to best practices of eXist-DB/Xquery in this context.

非常感谢.

推荐答案

正确,eXist 的 XInclude 实现专注于输出(即序列化)而不是查询或索引.正如 XInclude 上的 eXist 文档页面 所述:

Correct, eXist's XInclude implementation is focused on output (i.e., serialization) rather than on querying or indexing. As eXist's documentation page on XInclude states:

XInclude 处理器被实现为序列化器的输出事件流和接收器之间的过滤器...因此,每当 eXist-db 序列化 XML 片段时,无论它是文档、XQuery 的结果还是一个XSLT 样式表.

The XInclude processor is implemented as a filter in between the serializer's output event stream and the receiver... XInclude processing is therefore applied whenever eXist-db serializes an XML fragment, whether it's a document, the result of an XQuery or an XSLT stylesheet.

因此,如果您使用 XInclude 来组装您的语料库并且您想要查询/遍历该语料库,您可以通过 (1) 编写一个查询来读取您的 XInclude 并像映射一样跟随它来查找组件文档,(2) 将您的数据预先序列化为一个新文档,然后直接查询生成的文档,或 (3) 将文档放入集合中,以便于您想要执行的查询类型.

Thus, if you use XInclude to assemble your corpus and you want to query/traverse this corpus, you could do so by (1) writing a query to read your XInclude and following it like a map to find the component documents, (2) pre-serializing your data into a new document and then querying the resulting document directly, or (3) placing the documents into collections that facilitate the kinds of queries you want to do.

这篇关于eXist DB 和 Xquery:xincludes 或集合 (TEI-XML)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆