unknown name code during parsing
Added by Anonymous almost 20 years ago
Legacy ID: #2899269 Legacy Poster: marcvc (marcvc)
Michael, using Saxon 8.1.1, consider the following query: for $v in doc("foo.xml")/* return <e a="{$v/child::element(e)}"/> It results in: java.lang.IllegalArgumentException: Unknown name code 1048575 at net.sf.saxon.om.NamePool.unknownNameCode(NamePool.java:657) at net.sf.saxon.om.NamePool.getURI(NamePool.java:509) at net.sf.saxon.expr.ExpressionParser.parseKindTest(ExpressionParser.java:1359) at net.sf.saxon.expr.ExpressionParser.parseNodeTest(ExpressionParser.java:1226) at net.sf.saxon.expr.ExpressionParser.parseBasicStep(ExpressionParser.java:1146) at net.sf.saxon.expr.ExpressionParser.parseStepExpression(ExpressionParser.java:1005) at net.sf.saxon.expr.ExpressionParser.parseRelativePath(ExpressionParser.java:978) ... Thanks, Marc
Replies (1)
RE: unknown name code during parsing - Added by Anonymous almost 20 years ago
Legacy ID: #2908280 Legacy Poster: Michael Kay (mhkay)
Thanks. This problem is still present in 8.2. It occurs when a construct such as element(x) appears as a step within a path expression within an attribute of a direct element constructor in XQuery (name resolution in this situation is rather unusual because the namespace declarations are not known at the time the expression is parsed): they might appear after the attribute. I have added a test case (qxmp198). The following source change fixes the immediate problem, though I have not tested for side effects: In 8.2, net.sf.saxon.expr.ExpressionParser, change line 1387 from nameCode = makeNameCode(t.currentTokenValue, true) & 0xfffff; to nameCode = makeNameCode(t.currentTokenValue, true); In lines 1410 and 1428, change nameCode to nameCode & 0xfffff
Please register to reply