/** * Transforms the given JAXP source into the given result. * * @param source * The JAXP source object. * @param result * The JAXP result object. * @throws IOException */ public void transform(Source source, Result result) throws IOException { if (getTransformer() == null) { Context.getCurrentLogger() .warning( "Unable to apply the transformation. No transformer found!"); } else { try { // Generates the result of the transformation getTransformer().transform(source, result); } catch (TransformerException te) { throw new IOException("Transformer exception. " + te.getMessage()); } } }
@Override public void write(OutputStream outputStream) throws IOException { if (getTransformer() == null) { Context .getCurrentLogger() .warning( "Unable to apply the transformation. No transformer found!"); } else { try { // Generates the result of the transformation getTransformer().transform(getSaxSource(), new StreamResult(outputStream)); } catch (TransformerException te) { throw new IOException("Transformer exception. " + te.getMessage()); } } } }
/** * Parses the input source by sending the result event to the * XML reader's content handler. * * @param input * The input source. */ public void parse(InputSource input) throws IOException, SAXException { try { source.getTransformer().transform( source.getSaxSource(), new SAXResult(getContentHandler())); } catch (TransformerException te) { throw new IOException("Transformer exception. " + te.getMessage()); } }