public static XPathPathExpr getPathExpr(String nodeset) { XPathExpression path; Boolean validNonPathExpr = false; try { path = XPathParseTool.parseXPath(nodeset); if (!(path is XPathPathExpr)) { validNonPathExpr = true; throw new XPathSyntaxException(); } } catch (XPathSyntaxException xse) { //make these checked exceptions? if (validNonPathExpr) { throw new SystemException("Expected XPath path, got XPath expression: [" + nodeset + "]"); } else { throw new SystemException("Parse error in XPath path: [" + nodeset + "]"); } } return((XPathPathExpr)path); }
private void attemptConstraintCompile() { xPathConstraintMsg = null; try { if (constraintMsg != null) { xPathConstraintMsg = XPathParseTool.parseXPath("string(" + constraintMsg + ")"); } } catch (Exception e) { //Expected in probably most cases. } }