/** * Writes the transformed source into the given JAXP result. The source is * retrieved using the {@link #getSaxSource()} method. * * @param result * The JAXP result object. * @throws IOException */ public void write(Result result) throws IOException { transform(getSaxSource(), result); }
/** * 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()); } }
@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()); } } } }