/** * Evaluate as a singleton item * * @param c the dynamic XPath evaluation context */ public Item evaluateItem(XPathContext c) throws XPathException { XPathContext c1 = c.newMinorContext(); try { return ExpressionTool.eagerEvaluate(tryOp.getChildExpression(), c1).head(); } catch (XPathException err) { if (err.isGlobalError()) { err.setIsGlobalError(false); } else { StructuredQName code = err.getErrorCodeQName(); if(code == null) { code = new StructuredQName("err", NamespaceConstant.SAXON,"SXWN9000"); } for (CatchClause clause : catchClauses) { if (clause.nameTest.matches(code)) { Expression caught = clause.catchOp.getChildExpression(); XPathContextMajor c2 = c.newContext(); c2.setCurrentException(err); return caught.evaluateItem(c2); } } } err.setHasBeenReported(false); throw err; } }
/** * Evaluate as a singleton item * * @param c the dynamic XPath evaluation context */ public Item evaluateItem(XPathContext c) throws XPathException { XPathContext c1 = c.newMinorContext(); try { return ExpressionTool.eagerEvaluate(tryOp.getChildExpression(), c1).head(); } catch (XPathException err) { if (err.isGlobalError()) { err.setIsGlobalError(false); } else { StructuredQName code = err.getErrorCodeQName(); if(code == null) { code = new StructuredQName("err", NamespaceConstant.SAXON,"SXWN9000"); } for (CatchClause clause : catchClauses) { if (clause.nameTest.matches(code)) { Expression caught = clause.catchOp.getChildExpression(); XPathContextMajor c2 = c.newContext(); c2.setCurrentException(err); return caught.evaluateItem(c2); } } } err.setHasBeenReported(false); throw err; } }
Expression caught = clause.catchOp.getChildExpression(); XPathContextMajor c2 = c.newContext(); c2.setCurrentException(err);
Expression caught = clause.catchOp.getChildExpression(); XPathContextMajor c2 = c.newContext(); c2.setCurrentException(err);