saxon:parse can result in NPE
Added by Anonymous almost 19 years ago
Legacy ID: #3534625 Legacy Poster: marcvc (marcvc)
Micahel, I was playing around with saxon:parse(). It seems to result in a NPE when the argument value is statically known. saxon:parse("<e/>") results in java.lang.NullPointerException at net.sf.saxon.functions.Parse.evaluateItem(Parse.java:53) at net.sf.saxon.expr.ExpressionTool.eagerEvaluate(ExpressionTool.java:296) at net.sf.saxon.expr.FunctionCall.preEvaluate(FunctionCall.java:163) at net.sf.saxon.expr.FunctionCall.typeCheck(FunctionCall.java:113) at net.sf.saxon.query.XQueryExpression.<init>(XQueryExpression.java:64) at net.sf.saxon.query.QueryParser.makeXQueryExpression(QueryParser.java:109) at net.sf.saxon.query.StaticQueryContext.compileQuery(StaticQueryContext.java:451) at net.sf.saxon.query.StaticQueryContext.compileQuery(StaticQueryContext.java:509) at net.sf.saxon.Query.doMain(Query.java:340) at net.sf.saxon.Query.main(Query.java:76) Marc
Replies (1)
RE: saxon:parse can result in NPE - Added by Anonymous almost 19 years ago
Legacy ID: #3534678 Legacy Poster: Michael Kay (mhkay)
Thanks, I've fixed this by preventing static evaluation by adding the method public Expression preEvaluate(StaticContext env) throws XPathException { return this; } in net.sf.saxon.functions.Parse
Please register to reply