/** * Writes the supplied search result to the writer. * * @param result search result to write * * @throws IOException if an error occurs using the writer */ @Override public void write(final SearchResult result) throws IOException { try { final Transformer transformer = TRANSFORMER_FACTORY.newTransformer(); for (Map.Entry<String, String> prop : outputProperties.entrySet()) { transformer.setOutputProperty(prop.getKey(), prop.getValue()); } final StreamResult sr = new StreamResult(dsmlWriter); final DOMSource source = new DOMSource(createDsml(result)); transformer.transform(source, sr); dsmlWriter.flush(); } catch (ParserConfigurationException | TransformerException e) { throw new IOException(e); } }
/** * Writes the supplied search result to the writer. * * @param result search result to write * * @throws IOException if an error occurs using the writer */ @Override public void write(final SearchResult result) throws IOException { try { final Transformer transformer = TRANSFORMER_FACTORY.newTransformer(); for (Map.Entry<String, String> prop : outputProperties.entrySet()) { transformer.setOutputProperty(prop.getKey(), prop.getValue()); } final StreamResult sr = new StreamResult(dsmlWriter); final DOMSource source = new DOMSource(createDsml(result)); transformer.transform(source, sr); dsmlWriter.flush(); } catch (ParserConfigurationException | TransformerException e) { throw new IOException(e); } }
/** * Writes the supplied search result to the writer. * * @param result search result to write * * @throws IOException if an error occurs using the writer */ @Override public void write(final SearchResult result) throws IOException { try { final Transformer transformer = TRANSFORMER_FACTORY.newTransformer(); for (Map.Entry<String, String> prop : outputProperties.entrySet()) { transformer.setOutputProperty(prop.getKey(), prop.getValue()); } final StreamResult sr = new StreamResult(dsmlWriter); final DOMSource source = new DOMSource(createDsml(result)); transformer.transform(source, sr); dsmlWriter.flush(); } catch (ParserConfigurationException | TransformerException e) { throw new IOException(e); } }