Project

Profile

Help

Saxon9.1: NPE in QueryParser.parseForClause()

Added by Anonymous almost 15 years ago

Legacy ID: #7475429 Legacy Poster: Wouter Cordewiner (wcordewiner)

Granted, not the most typical use case and can easily be worked around by pulling the FLWOR out of the attribute content: <e attr="{for $x at $y in (1,2,3) return $y}"/> gives with Saxon 9.1: java.lang.NullPointerException at net.sf.saxon.query.QueryParser.parseForClause(QueryParser.java:1849) at net.sf.saxon.query.QueryParser.parseForExpression(QueryParser.java:1640) at net.sf.saxon.expr.ExpressionParser.parseExprSingle(ExpressionParser.java:338) at net.sf.saxon.expr.ExpressionParser.parseExpression(ExpressionParser.java:306) at net.sf.saxon.expr.ExpressionParser.parse(ExpressionParser.java:228) at net.sf.saxon.query.QueryParser.makeAttributeContent(QueryParser.java:3131) at net.sf.saxon.query.QueryParser.parseDirectElementConstructor(QueryParser.java:2840) at net.sf.saxon.query.QueryParser.parsePseudoXML(QueryParser.java:2767) at net.sf.saxon.query.QueryParser.parseConstructor(QueryParser.java:2357) at net.sf.saxon.expr.ExpressionParser.parseBasicStep(ExpressionParser.java:1387) at net.sf.saxon.expr.ExpressionParser.parseStepExpression(ExpressionParser.java:1213) ...


Replies (1)

RE: Saxon9.1: NPE in QueryParser.parseForClause() - Added by Anonymous almost 15 years ago

Legacy ID: #7475457 Legacy Poster: Michael Kay (mhkay)

Thanks for reporting this. It will affect any FOR expression with a positional variable appearing between curly braces in attribute content (Saxon parses such expressions twice, because they may be subject to namespace declarations that have not yet been read. The first pass should be a syntax-check only, to locate the closing "}". But with a positional FOR expression, some semantic analysis is being done.) I'll raise a bug report and a patch.

    (1-1/1)

    Please register to reply