XQuery 编辑

XQuery is a W3C standard language which is meant to be for XML what SQL is for relational data--i.e., the ability to search, sort, extract, and remold data. It offers powerful and yet intuitive searching based on XPath, has SQL-like syntax for the query portion, and has scripting features such as function and variable definitions, XML-inclusion, etc.

While XQuery is currently not supported in Firefox (whether through JavaScript to developers or to browser users), at least one extension has been developed to give a preliminary support for XQuery for browser users (and serving as a simple model for how XQuery can be implemented within extensions).

XqUSEme is a working proof-of-concept (so far tested on Windows; Mac does not work) extension which allows one to perform XQueries on external URLs, the currently loaded webpage (even if originally from poorly formed HTML), and/or XML (including well-formed XHTML) documents stored locally.

The extension now includes and interfaces with the open-source version of Saxonica's Saxon B by default, while optionally allowing association with an installation of Berkeley DB XML, as a database system has the advantage of allowing local storage and indexing (though this extension currently only performs the XQueries). Other popular native XML databases might also be supported (e.g., eXist) in the future, especially now that the extension has added some basic support for the open-standard (XQJ) for Java and eXist is in the midst of getting such an API. Berkeley DB XML was the initial choice by the extension developer for its support across many languages (C++, Java, Python, Perl, PHP, etc.) (besides its also being open source).

A simple usage example is available.

Notes for developers wishing to access XQuery in their own extensions

At present, the extension works simply by using LiveConnect to work with Berkeley DB XML's Java API (and via a Java wrapper class which circumvents LiveConnect's current inability to handle some types of Java exceptions properly).

However, use of the approach of the Java Firefox extension might be used to turn the above extension concept into an XPCOM component (giving it access to all open windows), and for Berkeley DB XML, possibly implementing it in C++ instead, which is that database's original language of development.

However, the extension demonstrates a technique which does not depend on using XPCOM, while still giving full privileges.

Tutorials

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:176 次

字数:3751

最后编辑:7年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文