Matthew Graham | 1 Oct 2006 03:17
Picon

Re: xql, Javascript and XForms

Hi,

My XForms and XQuery are in an xql page - would I just define the 
JavaScript to be the return of another XQuery and then do something like:

<script type="text/javascript language="JavaScript" src="javascript.xql"/>

?

    Cheers,

    Matthew

Adam Retter wrote:
>
> Why not generate your JavaScript in a seperate XQuery and link them 
> into the xhtml page? That way you can generate the appropraite 
> media-type's for each. We do a similar thing for our application.
>
> BTW - this media-type=text/html method=xhtml is not the correct 
> mimetype for JavaScript.
>
> -----Original Message-----
> From: exist-open-bounces <at> lists.sourceforge.net on behalf of Matthew Graham
> Sent: Sat 30/09/2006 07:25
> To: exist-open <at> lists.sourceforge.net
> Subject: [Exist-open] xql, Javascript and XForms
>
> Hi,
>
(Continue reading)

Matthew Graham | 2 Oct 2006 09:15
Picon

Using XInclude in xql

Hi,

I have some static xhtml that I want to repeat in various different 
forms (using XForms and XQuery) and I thought that XInclude is the way 
to do this neatly (instead of cutting and pasting the same xhtml 
everywhere). So in my xql, I have:

<html xmlns="http://www.w3.org/1999/xhtml" 
xmlns:xi="http://www.w3.org/2001/XInclude">
  <head>
  ...
  <body>
    <xi:include href="menubar.xml"/>
   ...

where menubar.xml is just a <div> element containing some <ul> and <li>. 
Now when I try to load this in the browser, I get:

XML Parsing Error: mismatched tag. Expected: </link>.
Location: http://localhost:8080/geneapolis/index3.xql
Line Number 1, Column 105:<html><head><title>XQueryServlet 
Error</title><link rel="stylesheet" type="text/css" 
href="error.css"></head><body><div id="container"><h1>Error 
found</h1><h2>Message:null</h2><table id="javatrace"><caption>Java Stack 
Trace:</caption><tr><th>Class Name</th><th>Method Name</th><th>File 
Name</th><th>Line</th></tr><tr><td 
class="class">org.exist.storage.serializers.XIncludeFilter</td><td 
class="method">processXInclude</td><td 
class="file">XIncludeFilter.java</td><td 
class="line">234</td></tr><tr><td 
(Continue reading)

Oystein Reigem | 2 Oct 2006 10:59
Picon
Picon

Why isn't the use of range indexes reflected in profile log

I made a database with range indexes. Sometimes queries were slower to 
execute than I expected, making me suspect the indexes weren't used. I 
therefore included a
declare option exist:profiling "enabled=yes verbosity=5";
line in my queries, and grep'ed the profile.log* files for evidence of 
range index use, i.e, the occurrence of lines like
OPTIMIZATION Using value index to find key '...';
I almost never saw such lines in the log, and concluded my indexes 
weren't used.

It turns out the indexes were used after all. I was simply to slow to 
catch the evidence. The log files have a small default size so the lines 
reporting index used had been flushed at the time I looked for them.

Doh.

- Øystein -

--

-- 
Øystein Reigem, The department of culture, language and information technology (Aksis), Allegt 27,
N-5007 Bergen, Norway. Tel: +47 55 58 32 42. Fax: +47 55 58 94 70. E-mail: <oystein.reigem <at> aksis.uib.no>.
Home tel: +47 56 14 06 11. Mobile: +47 97 16 96 64. Home e-mail: <oreigem <at> broadpark.no>. Aksis home page: <www.aksis.uib.no>.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Adam Retter | 2 Oct 2006 11:25
Picon
Favicon

Re: xql, Javascript and XForms


Yes indeed :-)

-----Original Message-----
From: Matthew Graham [mailto:mjg <at> cacr.caltech.edu]
Sent: Sun 01/10/2006 02:17
To: Adam Retter
Cc: exist-open <at> lists.sourceforge.net
Subject: Re: [Exist-open] xql, Javascript and XForms

Hi,

My XForms and XQuery are in an xql page - would I just define the
JavaScript to be the return of another XQuery and then do something like:

<script type="text/javascript language="JavaScript" src="javascript.xql"/>

?

    Cheers,

    Matthew

Adam Retter wrote:
>
> Why not generate your JavaScript in a seperate XQuery and link them
> into the xhtml page? That way you can generate the appropraite
> media-type's for each. We do a similar thing for our application.
>
> BTW - this media-type=text/html method=xhtml is not the correct
> mimetype for JavaScript.
>
> -----Original Message-----
> From: exist-open-bounces <at> lists.sourceforge.net on behalf of Matthew Graham
> Sent: Sat 30/09/2006 07:25
> To: exist-open <at> lists.sourceforge.net
> Subject: [Exist-open] xql, Javascript and XForms
>
> Hi,
>
> I'm trying to write an xql file containing JavaScript and XForms to use
> with Firefox and its XForms plug-in. To get the XForms to work, I have
> to preface the file with:
>
> declare option exist:serialize "media-type=application/xhtml+xml";
>
> However, to get JavaScript working, I have to use:
>
> declare option exist:serialize "media-type=text/html method=xhtml";
>
> If I try combining these then the XForms do not render: how can I do
> this and what is the difference between media-type and method?
>
>     Cheers,
>
>     Matthew
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to
> share your
> opinions on IT & business topics through brief surveys -- and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> <http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV>
> _______________________________________________
> Exist-open mailing list
> Exist-open <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/exist-open
>


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Exist-open mailing list
Exist-open <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/exist-open
Adam Retter | 2 Oct 2006 11:26
Picon
Favicon

Re: Using XInclude in xql


Your code is not valid XHTML -

<link rel="stylesheet" type="text/css"
href="error.css">

has no end element as the error message suggests, so change it to either -

<link rel="stylesheet" type="text/css"
href="error.css"/>

or

<link rel="stylesheet" type="text/css"
href="error.css"></link>

Thanks Adam.


-----Original Message-----
From: exist-open-bounces <at> lists.sourceforge.net on behalf of Matthew Graham
Sent: Mon 02/10/2006 08:15
To: exist-open <at> lists.sourceforge.net
Subject: [Exist-open] Using XInclude in xql

Hi,

I have some static xhtml that I want to repeat in various different
forms (using XForms and XQuery) and I thought that XInclude is the way
to do this neatly (instead of cutting and pasting the same xhtml
everywhere). So in my xql, I have:

<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:xi="http://www.w3.org/2001/XInclude">
  <head>
  ...
  <body>
    <xi:include href="menubar.xml"/>
   ...

where menubar.xml is just a <div> element containing some <ul> and <li>.
Now when I try to load this in the browser, I get:

XML Parsing Error: mismatched tag. Expected: </link>.
Location: http://localhost:8080/geneapolis/index3.xql
Line Number 1, Column 105:<html><head><title>XQueryServlet
Error</title><link rel="stylesheet" type="text/css"
href="error.css"></head>

<snip/>

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Exist-open mailing list
Exist-open <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/exist-open
Wolfgang Meier | 2 Oct 2006 11:32
Picon

Re: Using XInclude in xql

> What am I doing wrong- my code does not contain any link elements? I'm
> using eXist-1.1RC2.

The result of the xinclude seems to be an error message, which is not
well-formed html and contains this link element.

I have to test this out myself. We might have a general problem with
xincludes within an XQuery...

Wolfgang

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Dave Howorth | 2 Oct 2006 16:12
Picon
Picon

REST interface status

I'm just starting to try to test eXist. I tried loading a document using
the REST interface, as implemented in the test client httpclient.pl

It appeared to work (the document is in the database) but produced
strange output:

 ./httpclient.pl -u dhoworth -p exist -c /db/sifts -s 1agm.xml
Storing document as 1agm.xml ...
<html>
<head>
<title>Error 200 Document 1agm.xml stored.</title>
</head>
<body>
<h2>HTTP ERROR: 200</h2><pre>Document 1agm.xml stored.</pre>
<p>RequestURI=/exist/rest/db/sifts/1agm.xml</p>
<p><i><small><a href="http://jetty.mortbay.org">Powered by
Jetty://</a></small></i></p>

<blank lines snipped>

</body>
</html>

Why does eXist think that 200 is an error?

Thanks, Dave

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Adam Retter | 2 Oct 2006 16:32
Picon
Favicon

Re: REST interface status


I think Alex mentioned this previously and there was a discussion about changing it, so perhaps Alex could shed some light on this...

Thanks Adam.


-----Original Message-----
From: Dannes Wessels [mailto:dizzzz <at> gmail.com]
Sent: Mon 02/10/2006 15:17
To: Dave Howorth
Cc: exist-open <at> lists.sourceforge.net; Adam Retter
Subject: Re: [Exist-open] REST interface status

HI

On 10/2/06, Dave Howorth <dhoworth <at> mrc-lmb.cam.ac.uk> wrote:
> <h2>HTTP ERROR: 200</h2><pre>Document 1agm.xml stored.</pre>
> Why does eXist think that 200 is an error?

well, it is a status code, not an error code (= status code with
negative side effect). maybe we should change that. from the specs in
http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html :

10.2.1 200 OK   =  The request has succeeded.

10.2.2 201 Created =  The request has been fulfilled and resulted in a
new resource being created.

Basically we should have a 201 here, not a 200. Adam ?

regards

Dannes


--
# Dannes Wessels # The Netherlands #
# Jabber / ICQ / MSN / AIM / Yahoo / gTalk / Skype #

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Exist-open mailing list
Exist-open <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/exist-open
Alex Milowski | 2 Oct 2006 16:45

Re: REST interface status

Dave Howorth wrote:
> I'm just starting to try to test eXist. I tried loading a document using
> the REST interface, as implemented in the test client httpclient.pl
> 
> It appeared to work (the document is in the database) but produced
> strange output:
> 
>  ./httpclient.pl -u dhoworth -p exist -c /db/sifts -s 1agm.xml
> Storing document as 1agm.xml ...
> <html>
> <head>
> <title>Error 200 Document 1agm.xml stored.</title>
> </head>
> <body>
> <h2>HTTP ERROR: 200</h2><pre>Document 1agm.xml stored.</pre>
> <p>RequestURI=/exist/rest/db/sifts/1agm.xml</p>
> <p><i><small><a href="http://jetty.mortbay.org">Powered by
> Jetty://</a></small></i></p>
> 
> <blank lines snipped>
> 
> </body>
> </html>
> 
> Why does eXist think that 200 is an error?

Yeah, that's annoying.  Just something that was probably quickly
implemented and never made to have a nicer response.  It does
return a 200 status code and so it is actually a success message.

I'd like to re-factor the rest interface into components that can
be re-combined via a web.xml.  I was waiting the the 1.1 branch to be
merged before I took that on.  When I did that, I was going to
deal with issues like the above.

In the meantime, we could "fix" this.  I wonder if people have
applications that rely upon XML coming back?

Possible solutions:

1. 201 Create w/ an XML status document of

    <resource href="/exist/rest/db/sifts/lagm.xml"/>

2. 204 No content

Thoughts?

--Alex Milowski

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Adam Retter | 2 Oct 2006 16:47
Picon
Favicon

Re: REST interface status



I dont have a problem with breaking backwards compatibility until we reach version 1.0 and 1.1 final.

But then I have never really minded breaking backwards compatibility, technology should move forwards...

Thanks Adam.

-----Original Message-----
From: exist-open-bounces <at> lists.sourceforge.net on behalf of Alex Milowski
Sent: Mon 02/10/2006 15:45
To: exist-open <at> lists.sourceforge.net
Subject: Re: [Exist-open] REST interface status

Dave Howorth wrote:
> I'm just starting to try to test eXist. I tried loading a document using
> the REST interface, as implemented in the test client httpclient.pl
>
> It appeared to work (the document is in the database) but produced
> strange output:
>
>  ./httpclient.pl -u dhoworth -p exist -c /db/sifts -s 1agm.xml
> Storing document as 1agm.xml ...
> <html>
> <head>
> <title>Error 200 Document 1agm.xml stored.</title>
> </head>
> <body>
> <h2>HTTP ERROR: 200</h2><pre>Document 1agm.xml stored.</pre>
> <p>RequestURI=/exist/rest/db/sifts/1agm.xml</p>
> <p><i><small><a href="http://jetty.mortbay.org">Powered by
> Jetty://</a></small></i></p>
>
> <blank lines snipped>
>
> </body>
> </html>
>
> Why does eXist think that 200 is an error?

Yeah, that's annoying.  Just something that was probably quickly
implemented and never made to have a nicer response.  It does
return a 200 status code and so it is actually a success message.

I'd like to re-factor the rest interface into components that can
be re-combined via a web.xml.  I was waiting the the 1.1 branch to be
merged before I took that on.  When I did that, I was going to
deal with issues like the above.

In the meantime, we could "fix" this.  I wonder if people have
applications that rely upon XML coming back?

Possible solutions:

1. 201 Create w/ an XML status document of

    <resource href="/exist/rest/db/sifts/lagm.xml"/>

2. 204 No content

Thoughts?

--Alex Milowski

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Exist-open mailing list
Exist-open <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/exist-open

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Exist-open mailing list
Exist-open <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/exist-open

Gmane