> However, eXist could be enhanced to use 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));