/** * Set the error event listener for the TransformerFactory, which * is used for the processing of transformation instructions, * and not for the transformation itself. * * @param listener The new error listener. * @throws IllegalArgumentException if listener is null. */ public void setErrorListener(ErrorListener listener) throws IllegalArgumentException { config.setErrorListener(listener); }
/** * Set the error event listener for the TransformerFactory, which * is used for the processing of transformation instructions, * and not for the transformation itself. * * @param listener The new error listener. * @throws IllegalArgumentException if listener is null. */ public void setErrorListener(ErrorListener listener) throws IllegalArgumentException { config.setErrorListener(listener); }
/** * Set the error event listener for the TransformerFactory, which * is used for the processing of transformation instructions, * and not for the transformation itself. * <p>This method is defined in JAXP but its use with Saxon is deprecated, * because the errorListener will be shared by all stylesheet compilations * running under this factory, which may be operating concurrently * in different threads.</p> * * @param listener The new error listener. * @throws IllegalArgumentException if listener is null. */ public void setErrorListener(ErrorListener listener) throws IllegalArgumentException { getConfiguration().setErrorListener(listener); }
/** * Set the error event listener for the TransformerFactory, which * is used for the processing of transformation instructions, * and not for the transformation itself. * <p>This method is defined in JAXP but its use with Saxon is deprecated, * because the errorListener will be shared by all stylesheet compilations * running under this factory, which may be operating concurrently * in different threads.</p> * * @param listener The new error listener. * @throws IllegalArgumentException if listener is null. */ public void setErrorListener(ErrorListener listener) throws IllegalArgumentException { getConfiguration().setErrorListener(listener); }
public Engine() throws Exception { String s = System.getProperty("te.cacheSize"); if (s != null) { cacheSize = Integer.parseInt(s); } // Create processor processor = new Processor(false); // Modify its configuration settings Configuration config = processor.getUnderlyingConfiguration(); config.setVersionWarning(false); // Use our custom error listener which reports line numbers in the CTL // source file errorListener = new TeErrorListener(); config.setErrorListener(errorListener); // Create a compiler and document builder compiler = processor.newXsltCompiler(); builder = processor.newDocumentBuilder(); // Load an executable for the TECore.form method ClassLoader cl = Thread.currentThread().getContextClassLoader(); InputStream is = cl.getResourceAsStream("com/occamlab/te/formfn.xsl"); formExecutable = compiler.compile(new StreamSource(is)); // Fortify Mod: We are done with the InputStream. Release the resource is.close(); }
public Engine() throws Exception { String s = System.getProperty("te.cacheSize"); if (s != null) { cacheSize = Integer.parseInt(s); } // Create processor processor = new Processor(false); // Modify its configuration settings Configuration config = processor.getUnderlyingConfiguration(); config.setVersionWarning(false); // Use our custom error listener which reports line numbers in the CTL // source file errorListener = new TeErrorListener(); config.setErrorListener(errorListener); // Create a compiler and document builder compiler = processor.newXsltCompiler(); builder = processor.newDocumentBuilder(); // Load an executable for the TECore.form method ClassLoader cl = Thread.currentThread().getContextClassLoader(); InputStream is = cl.getResourceAsStream("com/occamlab/te/formfn.xsl"); formExecutable = compiler.compile(new StreamSource(is)); // Fortify Mod: We are done with the InputStream. Release the resource is.close(); }
@Nonnull private XPath _createXPathContext () { final MapBasedNamespaceContext aNamespaceContext = getNamespaceContext (); final XPath aXPathContext = XPathHelper.createNewXPath (m_aXPathFactory, m_aXPathVariableResolver, m_aXPathFunctionResolver, aNamespaceContext); if ("net.sf.saxon.xpath.XPathEvaluator".equals (aXPathContext.getClass ().getName ())) { // Saxon implementation special handling final XPathEvaluator aSaxonXPath = (XPathEvaluator) aXPathContext; // Since 9.7.0-4 it must implement NamespaceResolver aSaxonXPath.setNamespaceContext (new SaxonNamespaceContext (aNamespaceContext)); // Wrap the PSErrorHandler to a ErrorListener aSaxonXPath.getConfiguration ().setErrorListener (new PSErrorListener (getErrorHandler ())); } return aXPathContext; }
@Nonnull private XPath _createXPathContext () { final MapBasedNamespaceContext aNamespaceContext = getNamespaceContext (); final XPath aXPathContext = XPathHelper.createNewXPath (m_aXPathFactory, m_aXPathVariableResolver, m_aXPathFunctionResolver, aNamespaceContext); if ("net.sf.saxon.xpath.XPathEvaluator".equals (aXPathContext.getClass ().getName ())) { // Saxon implementation special handling final XPathEvaluator aSaxonXPath = (XPathEvaluator) aXPathContext; // Since 9.7.0-4 it must implement NamespaceResolver aSaxonXPath.setNamespaceContext (new SaxonNamespaceContext (aNamespaceContext)); // Wrap the PSErrorHandler to a ErrorListener aSaxonXPath.getConfiguration ().setErrorListener (new PSErrorListener (getErrorHandler ())); } return aXPathContext; }
config2.setValidationWarnings(true); config2.setErrorListener(new ErrorListener() { public void error(TransformerException arg0) throws TransformerException {
saxonConfig.setErrorListener(errListener);
saxonConfig.setErrorListener(errListener);
config.setErrorListener(new ErrorListener() {
processor.getUnderlyingConfiguration().setErrorListener( saxonReporter); Source compiledTestAsSource = xspecTestCompiled.getXdmNode().asSource();
setErrorListener((ErrorListener) instantiateClassName(name, value, ErrorListener.class)); break;
setErrorListener((ErrorListener) instantiateClassName(name, value, ErrorListener.class)); break;
public SaxonXQueryExpression(String xQueryString, XMLNamespaces namespaces, List<DerivedColumn> passing, List<XMLTable.XMLColumn> columns) throws QueryResolverException { config.setErrorListener(ERROR_LISTENER); this.xQueryString = xQueryString; StaticQueryContext context = config.newStaticQueryContext();
saxonXQueryExpression.relativePaths = cc.getOptions().isRelativeXPath(); saxonXQueryExpression.config.setErrorListener(ERROR_LISTENER); saxonXQueryExpression.xQueryString = xQueryString; StaticQueryContext context = saxonXQueryExpression.config.newStaticQueryContext();
saxonXQueryExpression.relativePaths = cc.getOptions().isRelativeXPath(); saxonXQueryExpression.config.setErrorListener(ERROR_LISTENER); saxonXQueryExpression.xQueryString = xQueryString; StaticQueryContext context = saxonXQueryExpression.config.newStaticQueryContext();