private Pattern loadPattern(NodeInfo element) throws XPathException { String tag = element.getLocalPart(); PatternLoader loader = pMap.get(tag); if (loader == null) { //System.err.println("Cannot load pattern with tag " + tag); throw new XPathException("Cannot load pattern with tag " + tag, SaxonErrorCode.SXPK0002); } else { Pattern pat = loader.loadFrom(this, element); pat.setLocation(makeLocation(element)); pat.setRetainedStaticContext(makeRetainedStaticContext(element)); return pat; } }
private Pattern loadPattern(NodeInfo element) throws XPathException { String tag = element.getLocalPart(); PatternLoader loader = pMap.get(tag); if (loader == null) { //System.err.println("Cannot load pattern with tag " + tag); throw new XPathException("Cannot load pattern with tag " + tag, SaxonErrorCode.SXPK0002); } else { Pattern pat = loader.loadFrom(this, element); pat.setLocation(makeLocation(element)); pat.setRetainedStaticContext(makeRetainedStaticContext(element)); return pat; } }
/** * Make a pattern in the context of this stylesheet element * * @param pattern the source text of the pattern * @return the compiled pattern */ public Pattern makePattern(String pattern, String attributeName) { try { StaticContext env = getStaticContext(new StructuredQName("", "", attributeName)); Pattern p = Pattern.make(pattern, env, getCompilation().getPackageData()); p.setLocation(allocateLocation()); return p; } catch (XPathException err) { if ("XPST0003".equals(err.getErrorCodeLocalPart())) { err.setErrorCode("XTSE0340"); } compileError(err); NodeTestPattern nsp = new NodeTestPattern(AnyNodeTest.getInstance()); nsp.setLocation(allocateLocation()); return nsp; } }
/** * Make a pattern in the context of this stylesheet element * * @param pattern the source text of the pattern * @return the compiled pattern */ public Pattern makePattern(String pattern, String attributeName) { try { StaticContext env = getStaticContext(new StructuredQName("", "", attributeName)); Pattern p = Pattern.make(pattern, env, getCompilation().getPackageData()); p.setLocation(allocateLocation()); return p; } catch (XPathException err) { if ("XPST0003".equals(err.getErrorCodeLocalPart())) { err.setErrorCode("XTSE0340"); } compileError(err); NodeTestPattern nsp = new NodeTestPattern(AnyNodeTest.getInstance()); nsp.setLocation(allocateLocation()); return nsp; } }
Pattern p = new BasePatternWithPredicate( new NodeTestPattern(ErrorType.getInstance()), new ErrorExpression(err)); p.setLocation(allocateLocation()); return p;
Pattern p = new BasePatternWithPredicate( new NodeTestPattern(ErrorType.getInstance()), new ErrorExpression(err)); p.setLocation(allocateLocation()); return p;