Re: [basex-talk] Unconfirmed bug: NPE using cached transformer

2020-04-29 Thread Andrew Sales
Many thanks, Christian.

- Andrew

On Sun, 26 Apr 2020 at 11:15, Christian Grün 
wrote:

> Hi Andrew,
>
> > Error in xsl:sequence/@select on line 1 column 135 of [...]:
> >   FOER: Error signalled by application call on error()Improper use?
> Potentia
> > l bug? Your feedback is welcome:
>
> …fixed in the latest snapshot [1].
>
> > the error message is passed through for the first item in the sequence
> (), but is lost,  resulting in  when adjusted to error on
> subsequent items ( or ).
>
> I guess this only happens with Saxon and (as you already indicated) if
> the transformer is cached, so I’m not sure if we can fix this so
> easily. I’ll have some more thought.
>
> Best,
> Christian
>
> [1] http://files.basex.org/releases/latest/
>


Re: [basex-talk] Unconfirmed bug: NPE using cached transformer

2020-04-26 Thread Christian Grün
Hi Andrew,

> Error in xsl:sequence/@select on line 1 column 135 of [...]:
>   FOER: Error signalled by application call on error()Improper use? 
> Potentia
> l bug? Your feedback is welcome:

…fixed in the latest snapshot [1].

> the error message is passed through for the first item in the sequence 
> (), but is lost,  resulting in  when adjusted to error on 
> subsequent items ( or ).

I guess this only happens with Saxon and (as you already indicated) if
the transformer is cached, so I’m not sure if we can fix this so
easily. I’ll have some more thought.

Best,
Christian

[1] http://files.basex.org/releases/latest/


Re: [basex-talk] Unconfirmed bug: NPE using cached transformer

2020-04-25 Thread Bridger Dyson-Smith
Hi Andrew and list,

I ran into a similar error with 9.3.3-beta this last week but haven't had a
chance to work up a SSCCE.  Your report makes me think I need to do so!

Best,
Bridger

On Sat, Apr 25, 2020, 11:19 AM Andrew Sales  wrote:

> Hello,
>
> I'd like to run a transform on multiple documents using a cached
> transformer, accumulating any errors that occur.
>
> This minimal example -
>
> for $doc in (,, )
> return
> try{
> xslt:transform(
>   $doc,
>   http://www.w3.org/1999/XSL/Transform;
> version='2.0'>
> 
>   ,
>   map{},
>   map{'cache':'true'}
> )
> }
> catch * {$err:description}
>
> - results in:
>
> Error in xsl:sequence/@select on line 1 column 135 of [...]:
>   FOER: Error signalled by application call on error()Improper use?
> Potentia
> l bug? Your feedback is welcome:
> Contact: basex-talk@mailman.uni-konstanz.de
> Version: BaseX 9.3.2
> Java: Oracle Corporation, 1.8.0_241
> OS: Windows 7, amd64
> Stack Trace:
> java.lang.NullPointerException
> at org.basex.io.out.ArrayOutput.write(ArrayOutput.java:32)
> at java.io.OutputStream.write(Unknown Source)
> at java.io.PrintStream.write(Unknown Source)
> at sun.nio.cs.StreamEncoder.writeBytes(Unknown Source)
> at sun.nio.cs.StreamEncoder.implFlushBuffer(Unknown Source)
> at sun.nio.cs.StreamEncoder.flushBuffer(Unknown Source)
> at java.io.OutputStreamWriter.flushBuffer(Unknown Source)
> at java.io.PrintStream.write(Unknown Source)
> at java.io.PrintStream.print(Unknown Source)
> at java.io.PrintStream.println(Unknown Source)
> at net.sf.saxon.lib.StandardLogger.println(StandardLogger.java:121)
> at net.sf.saxon.lib.Logger.error(Logger.java:45)
> at
> net.sf.saxon.lib.StandardErrorListener.fatalError(StandardErrorListen
> er.java:305)
> at net.sf.saxon.Controller.reportFatalError(Controller.java:958)
> at net.sf.saxon.Controller.transform(Controller.java:1914)
> at
> net.sf.saxon.s9api.XsltTransformer.transform(XsltTransformer.java:579
> )
> at
> net.sf.saxon.jaxp.TransformerImpl.transform(TransformerImpl.java:185)
>
> at
> org.basex.query.func.xslt.XsltTransform.transform(XsltTransform.java:
> 135)
> at
> org.basex.query.func.xslt.XsltTransform.transform(XsltTransform.java:
> 62)
> at
> org.basex.query.func.xslt.XsltTransform.item(XsltTransform.java:40)
> at org.basex.query.expr.ParseExpr.value(ParseExpr.java:51)
> at org.basex.query.expr.Try.value(Try.java:94)
> at org.basex.query.expr.ParseExpr.iter(ParseExpr.java:46)
> at org.basex.query.expr.gflwor.GFLWOR$1.next(GFLWOR.java:72)
> at org.basex.query.QueryContext.next(QueryContext.java:353)
> at org.basex.query.scope.MainModule$1.next(MainModule.java:104)
> at org.basex.core.cmd.AQuery.query(AQuery.java:109)
> at org.basex.core.cmd.XQuery.run(XQuery.java:22)
> at org.basex.core.Command.run(Command.java:257)
> at org.basex.core.Command.execute(Command.java:93)
> at org.basex.api.client.LocalSession.execute(LocalSession.java:132)
> at org.basex.api.client.Session.execute(Session.java:36)
> at org.basex.core.CLI.execute(CLI.java:92)
> at org.basex.BaseX.(BaseX.java:107)
> at org.basex.BaseX.main(BaseX.java:43)
>
> The exception does not occur if 'cache' is set to 'false'.
>
> Relatedly, if I amend the query to this:
>
> for $doc in (,,)
> return
> try{
> xslt:transform(
>   $doc,
>   http://www.w3.org/1999/XSL/Transform;
>   xmlns:xs="http://www.w3.org/2001/XMLSchema; version='2.0'>
> 
>   
> 
>   ,
>   map{},
>   map{'cache':'true'}
> )
> }
> catch * {{$err:description}}
>
> the error message is passed through for the first item in the sequence
> (), but is lost,  resulting in  when adjusted to error on
> subsequent items ( or ).
>
> Again, this works as expected if the transformer is not cached.
>
> Thanks and regards,
> Andrew
>
>
> 
>  Virus-free.
> www.avast.com
> 
> <#m_-7045194468050368418_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>