XQIB brings the power, elegance and simplicity of XQuery to all browser users and developers. XQIB is a browser plugin which embeds Zorba. This plugin allows to execute XQuery in the same way you would execute JavaScript. Writing some functionality can be done in two simple steps:
- Create a <script/> tag with the type “text/xqueryp” in the head of the document
- Declare and implement a new function “main” in the local namespace, which will be executed after the page has loaded.
So a simple hello world looks like this:
<?xml version=’1.0′ encoding=”utf-8″?>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd“>
<html xmlns=”http://www.w3.org/1999/xhtml“>
<head>
<script type=”text/xqueryp”>
declare function local:main() {
browser:alert(//H1)
};
</script>
</head>
<body>
<h1>Hello, world!</h1>
</body>
</html>
For more information, please visit the XQIB Homepage at http://www.xqib.org/.