I testet it on my local machine with a CVS download from 2005-10-14 and
also on a remote machine with eXist-1.0b2-build-1107.war
The results are the same except for one query where I get "500 Internal
Server Error" on the remote machine and have no problems on the local
This query has nothing remarkable except for a transform. I cannot find
anything in the logs in /opt/tomcat5/webapps/exist/WEB-INF/logs
How can I debug this one?
Try wrapping the body of your XQuery in a CDATA block. Note also that when
creating a query as a Perl string it's also necessary to escape any $ and @
characters that need to be passed to the XQuery engine as is. Unescaped
symbols, such as $term1 below, of course trigger the usual variable
substitutions, whereas the escaped \$para has become the XQuery variable
name $para by the time eXist gets to see it.
Here's one of mine:
my $QUERY0 = <<EOT;
<?xml version="1.0" encoding="UTF-8"?>
for \$para in /text/div/p[match-any(.,'$term1')]
order by \$para/\@tstamp
This then gets dispatched like so
my $ua = LWP::UserAgent->new();
my $req = HTTP::Request->new(POST => $URL);
my $result = $ua->request($req);
>Try wrapping the body of your XQuery in a CDATA block.
Thanks, that was the problem, and now I also found it as a note in the
> Note also that when
>creating a query as a Perl string it's also necessary to escape any $ and @
>characters that need to be passed to the XQuery engine as is.
To avoid this escaping I saved the XQueries in files and load those,
that works fine.