mozilla

Revision 140947 of XQuery

  • Revision slug: XQuery
  • Revision title: XQuery
  • Revision id: 140947
  • Created:
  • Creator: Brettz9
  • Is current revision? No
  • Comment +page

Revision Content

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 support does not yet exist 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 (registration required as extension is still under review) is a proof-of-concept (presently Windows-only) extension which allows one to perform XQueries on external URL's, the currently loaded webpage (even if originally from poorly formed HTML), and/or XML (including well-formed XHTML) documents stored locally.

While an implementation could be envisioned which did not have the (large) overhead of a database system (e.g., by interfacing with the open-source version of Saxonica's Saxon B), a database system has the advantage of allowing local storage and indexing. Other popular native XML databases might also be supported (e.g., eXist), especially with an open-standard (XQJ) for Java apparently around the corner, but Berkeley DB XML was chosen by the extension developer for its support across many languages (C++, Java, Python, Perl, PHP, etc.) (besides being open source).

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 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 possibly implementing it in C++ instead, which is the database's original language of development.

Tutorials

Revision Source

<p><a class="external" href="http://www.w3.org/TR/xquery/">XQuery</a> 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.
</p><p>While XQuery support does not yet exist 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).
</p><p><a class="external" href="https://addons.mozilla.org/en-US/firefox/addon/5515">XqUSEme</a> (registration required as extension is still under review) is a proof-of-concept (presently Windows-only) extension which allows one to perform XQueries on external URL's, the currently loaded webpage (even if originally from poorly formed HTML), and/or XML (including well-formed XHTML) documents stored locally.
</p><p>While an implementation could be envisioned which did not have the (large) overhead of a database system (e.g., by interfacing with the open-source version of <a class="external" href="http://www.saxonica.com/">Saxonica's Saxon B</a>), a database system has the advantage of allowing local storage and indexing. Other popular native XML databases might also be supported (e.g., eXist), especially with an open-standard (<a class="external" href="http://jcp.org/en/jsr/detail?id=225">XQJ</a>) for Java apparently around the corner, but Berkeley DB XML was chosen by the extension developer for its support across many languages (C++, Java, Python, Perl, PHP, etc.) (besides being open source).
</p><p>At present, the extension works simply by using <a href="en/LiveConnect">LiveConnect</a> to work with Berkeley DB XML's Java API (and via a Java wrapper class which circumvents LiveConnect's inability to handle some types of Java exceptions properly). However, use of the approach of the <a href="en/Java_in_Firefox_Extensions">Java Firefox extension</a> might be used to turn the above extension concept into an XPCOM component (giving it access to all open windows), and possibly implementing it in C++ instead, which is the database's original language of development.
</p>
<h3 name="Tutorials">Tutorials</h3>
<ul><li> <a class="external" href="http://www.w3schools.com/xquery/default.asp">W3Schools</a>
</li><li> <a class="external" href="http://www.stylusstudio.com/xquery_primer.html">Learn XQuery in 10 minutes</a>
</li><li> <a class="external" href="http://www.ibm.com/developerworks/xml/library/x-xquery.html">An introduction to XQuery</a>
</li></ul>
Revert to this revision