/** * Initialize this XsltView's TransformerFactory. */ @Override protected void initApplicationContext() throws BeansException { this.transformerFactory = newTransformerFactory(this.transformerFactoryClass); this.transformerFactory.setErrorListener(this.errorListener); if (this.uriResolver != null) { this.transformerFactory.setURIResolver(this.uriResolver); } if (this.cacheTemplates) { this.cachedTemplates = loadTemplates(); } }
transformerFactory.setErrorListener(errorListener);
/** * Initialize this XsltView's TransformerFactory. */ @Override protected void initApplicationContext() throws BeansException { this.transformerFactory = newTransformerFactory(this.transformerFactoryClass); this.transformerFactory.setErrorListener(this.errorListener); if (this.uriResolver != null) { this.transformerFactory.setURIResolver(this.uriResolver); } if (this.cacheTemplates) { this.cachedTemplates = loadTemplates(); } }
tfactory.setErrorListener(this);
tfactory.setErrorListener(new DefaultErrorHandler(false));
public void setErrorListener(ErrorListener listener) { actual.setErrorListener(listener); }
public void setErrorListener(ErrorListener l) { _transformerFactory.setErrorListener(l); }
/** * Constructor * * @param transformerFactory - Transformer Factory to use * */ public XsltTransformer(final TransformerFactory transformerFactory) { this.transformerFactory = transformerFactory; if (this.transformerFactory == null) { throw new IllegalArgumentException("The TransformerFactory cannot be null."); } this.transformerFactory.setErrorListener(this.errorListener); }
/** * Constructor * * @param transformerFactory - Transformer Factory to use * */ public XsltConverter(final TransformerFactory transformerFactory) { this.transformerFactory = transformerFactory; if (this.transformerFactory == null) { throw new IllegalArgumentException("The TransformerFactory cannot be null."); } this.transformerFactory.setErrorListener(this.errorListener); }
private static TransformerFactory createTransformFactory() { TransformerFactory factory = TransformerFactory.newInstance(); factory.setErrorListener(new XMLListener()); return factory; };
private static TransformerFactory createTransformFactory() { TransformerFactory factory = TransformerFactory.newInstance(); factory.setErrorListener(new XMLListener()); return factory; };
private ProcessHTTPRecordingWithXSLT(InputStream styleSheetInputStream, PrintWriter output, Logger logger) { m_styleSheetInputStream = styleSheetInputStream; m_output = output; m_logger = logger; // We set our own ErrorListener because the behaviour (e.g. logging to // System.err) of the default ErrorListener depends on the JDK. This is not // perfect (JDK 1.5.0_3 still logs some things to stderr). m_transformerFactory.setErrorListener(new LoggingErrorListener()); }
@Override public String getXML(final Document doc) throws TransformerConfigurationException, TransformerException { final Source source = new DOMSource(doc); final StringWriter stringWriter = new StringWriter(); final Result result = new StreamResult(stringWriter); // Java XML factories are not declared to be thread safe final TransformerFactory factory = TransformerFactory.newInstance(); factory.setErrorListener(new XMLListener()); final Transformer transformer = factory.newTransformer(); transformer.transform(source, result); return stringWriter.getBuffer().toString(); }
TransformerFactory factory = TransformerFactory.newInstance(); factory.setErrorListener(new ErrorListener( ... )); xslTemplate = factory.newTemplates(new StreamSource( ... ));
@Override public String getXML(final Document doc) throws TransformerConfigurationException, TransformerException { final Source source = new DOMSource(doc); final StringWriter stringWriter = new StringWriter(); final Result result = new StreamResult(stringWriter); // Java XML factories are not declared to be thread safe final TransformerFactory factory = TransformerFactory.newInstance(); factory.setErrorListener(new XMLListener()); final Transformer transformer = factory.newTransformer(); transformer.transform(source, result); return stringWriter.getBuffer().toString(); }
public void transform(Document sourceDocument, Node resultParentNode, URL stylesheet) throws XMLPlatformException { try { TransformerFactory transformerFactory = TransformerFactory.newInstance(); transformerFactory.setErrorListener(new TransformErrorListener()); StreamSource stylesheetSource = new StreamSource(stylesheet.openStream()); Transformer transformer = transformerFactory.newTransformer(stylesheetSource); DOMSource source = new DOMSource(sourceDocument); DOMResult result = new DOMResult(resultParentNode); transformer.transform(source, result); } catch (Exception e) { throw XMLPlatformException.xmlPlatformTransformException(e); } }
public void transform(Document sourceDocument, Node resultParentNode, URL stylesheet) throws XMLPlatformException { try { TransformerFactory transformerFactory = TransformerFactory.newInstance(); transformerFactory.setErrorListener(new TransformErrorListener()); StreamSource stylesheetSource = new StreamSource(stylesheet.openStream()); Transformer transformer = transformerFactory.newTransformer(stylesheetSource); DOMSource source = new DOMSource(sourceDocument); DOMResult result = new DOMResult(resultParentNode); transformer.transform(source, result); } catch (Exception e) { throw XMLPlatformException.xmlPlatformTransformException(e); } }
protected void createTransformer() throws Exception { this.factory.setErrorListener( this.errors ); this.factory.setURIResolver( uriResolver ); this.transformer = this.factory.newTransformer( this.xsltSource ); this.transformer.setErrorListener( this.errors ); this.transformer.setOutputProperty( OutputKeys.OMIT_XML_DECLARATION, "yes" ); }
@Override public void transform(Document sourceDocument, Node resultParentNode, URL stylesheet) throws XMLPlatformException { try { TransformerFactory transformerFactory = XMLHelper.createTransformerFactory(false); transformerFactory.setErrorListener(new TransformErrorListener()); StreamSource stylesheetSource = new StreamSource(stylesheet.openStream()); Transformer transformer = transformerFactory.newTransformer(stylesheetSource); DOMSource source = new DOMSource(sourceDocument); DOMResult result = new DOMResult(resultParentNode); transformer.transform(source, result); } catch (Exception e) { throw XMLPlatformException.xmlPlatformTransformException(e); } }
/** * Initialize this XsltView's TransformerFactory. */ @Override protected void initApplicationContext() throws BeansException { this.transformerFactory = newTransformerFactory(this.transformerFactoryClass); this.transformerFactory.setErrorListener(this.errorListener); if (this.uriResolver != null) { this.transformerFactory.setURIResolver(this.uriResolver); } if (this.cacheTemplates) { this.cachedTemplates = loadTemplates(); } }