tags:

views:

756

answers:

4

Hi guys,

Can someone give an example of an html page that uses xquery, do you need something else in order to run xquery.

I tried to run some xquery code from w3schools but it is not evaluating in the html page.

<html>
  <ul>
  {
    for $x in doc("books.xml")/bookstore/book/title
      order by $x
      return <li>{$x}</li>
    }
  </ul>
</html>
+1  A: 

XML Query (XQuery) Implementations

Jonathan Sampson
Thanks!....I just wanted a html snippet that worked, that I can run in a browser and shows a demonstration of xquery.
+2  A: 

Uhmm... I guess this is a misunderstanding.

Neither javascript itself or any webbrowser (IE, FF, Opera, ...) are XQuery capable or have support build in. You need some other software which has XQuery implemented (check the link provided by Jonathan Sampson). That software could be called from your html site and the results displayed inline

e.g. the wikibook about XQuery uses a eXist server to run their samples and output the result to the browser.

jitter
+1  A: 

Like my previous speakers said, there is no native support for XQuery in any browser today. But at least for Firefox there seems to exist a plugin: XQuery USE ME

Cheers,

Boldewyn
A: 

In addition to the mentioned links take a look at http://en.wikibooks.org/wiki/XRX for an introduction to the kind of architecture you might find useful.

Even if you're just window shopping at the moment, XRX is worth paying attention to.