/** * Register the binding between a variableExpr name and variableExpr expression * @param varName * @param varExpr * @throws XPathParseException */ public void declareVariableExpr(String varName, String varExpr) throws XPathParseException { try{ parser p = new parser(new StringReader(varExpr)); p.nsHash = nsHash; p.symbolHash = symbolHash; xpe = (Expr) p.parse().value; symbolHash.put(varName, xpe); ft = true; }catch(XPathParseException e){ System.out.println("Syntax error after or around the end of ==>"+varExpr.substring(0,e.getOffset())); throw e; }catch(Exception e){ throw new XPathParseException("Error occurred"); } }
/** * Register the binding between a variableExpr name and variableExpr expression * @param varName * @param varExpr * @throws XPathParseException */ public void declareVariableExpr(String varName, String varExpr) throws XPathParseException { try{ parser p = new parser(new StringReader(varExpr)); p.nsHash = nsHash; p.symbolHash = symbolHash; xpe = (Expr) p.parse().value; symbolHash.put(varName, xpe); ft = true; }catch(XPathParseException e){ System.out.println("Syntax error after or around the end of ==>"+varExpr.substring(0,e.getOffset())); throw e; }catch(Exception e){ throw new XPathParseException("Error occurred"); } }
/** * Register the binding between a variableExpr name and variableExpr * expression * * @param varName * @param varExpr * @throws XPathParseException */ public void declareVariableExpr(String varName, String varExpr) throws XPathParseException { try { parser p = new parser(new StringReader(varExpr)); p.nsHash = nsHash; p.symbolHash = symbolHash; xpe = (Expr) p.parse().value; symbolHash.put(varName, xpe); ft = true; } catch (XPathParseException e) { System.out.println("Syntax error after or around the end of ==>" + varExpr.substring(0, e.getOffset())); throw e; } catch (Exception e) { throw new XPathParseException("Error occurred"); } }
/** * This method selects the string representing XPath expression * Usually evalXPath is called afterwards * @param s * @throws XPathParseException */ public void selectXPath(String s) throws XPathParseException { try{ parser p = new parser(new StringReader(s)); p.nsHash = nsHash; p.symbolHash = symbolHash; xpe = (com.ximpleware.Expr) p.parse().value; ft = true; if (enableCaching) xpe.markCacheable(); }catch(XPathParseException e){ System.out.println("Syntax error after or around the end of ==>"+s.substring(0,e.getOffset())); throw e; }catch(Exception e){ throw new XPathParseException("Error occurred"); } }
/** * This method selects the string representing XPath expression * Usually evalXPath is called afterwards * @param s * @throws XPathParseException */ public void selectXPath(String s) throws XPathParseException { try{ parser p = new parser(new StringReader(s)); p.nsHash = nsHash; p.symbolHash = symbolHash; xpe = (com.ximpleware.Expr) p.parse().value; ft = true; if (enableCaching) xpe.markCacheable(); }catch(XPathParseException e){ System.out.println("Syntax error after or around the end of ==>"+s.substring(0,e.getOffset())); throw e; }catch(Exception e){ throw new XPathParseException("Error occurred"); } }
/** * This method selects the string representing XPath expression Usually * evalXPath is called afterwards * * @param s * @throws XPathParseException */ public void selectXPath(String s) throws XPathParseException { try { parser p = new parser(new StringReader(s)); p.nsHash = nsHash; p.symbolHash = symbolHash; xpe = (com.ximpleware.Expr) p.parse().value; ft = true; if (enableCaching) xpe.markCacheable(); } catch (XPathParseException e) { System.out.println("Syntax error after or around the end of ==>" + s.substring(0, e.getOffset())); throw e; } catch (Exception e) { throw new XPathParseException("Error occurred"); } }