Improving CocoonSource

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Improving CocoonSource

Jean-Baptiste Quenot-2
Hello,

I noticed a problem when using a SitemapSource (cocoon://) as
source of the XQueryGenerator: source.getInputStream() is called
twice, making the request fail.

This is a Cocoon bug filed at Apache:
http://issues.apache.org/bugzilla/show_bug.cgi?id=37049

However, eXist could be enhanced to use [1]PushbackInputStream to
avoid an extra expensive call to getInputStream() in
CocoonSource.checkEncoding() and CocoonSource.getContent()

There is also the possibility to modify XQueryGenerator to disable
encoding verification:

ResourceSet result = service.execute(new CocoonSource(inputSource, false));
                                                                   ^^^^^

WDYT?
--
Jean-Baptiste Quenot
Systèmes d'Information
ANYWARE TECHNOLOGIES
Tel : +33 (0)5 61 00 52 90
Fax : +33 (0)5 61 00 51 46
http://www.anyware-tech.com/

[1] http://java.sun.com/j2se/1.4.2/docs/api/java/io/PushbackInputStream.html


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: Improving CocoonSource

wolfgangmm
> However, eXist could be enhanced to use [1]PushbackInputStream to
> avoid an extra expensive call to getInputStream() in
> CocoonSource.checkEncoding() and CocoonSource.getContent()

I would like to keep the encoding verification. The XQuery engine
should respect any "xquery encoding=..." hint in the prolog, though
this means it needs to read the first lines of the input stream.
Unfortunately, I couldn't find a way to switch the character encoding
on a stream while already reading it. Using PushbackInputStream sounds
like the better alternative.

> There is also the possibility to modify XQueryGenerator to disable
> encoding verification:
>
> ResourceSet result = service.execute(new CocoonSource(inputSource, false));

Wolfgang


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open