final org.w3c.dom.Document w3cDoc = new DOMOutputter().output(document); final IIOMetadata iioMetadata = new TIFFImageMetadata(
private org.w3c.dom.Document asInputW3cDocument(final List<ToDoItem> items) throws JDOMException { final Document jdomDoc = asInputDocument(items); final DOMOutputter domOutputter = new DOMOutputter(); return domOutputter.output(jdomDoc); }
/** Show writing out DOM document. * @param jdomDocument * @param domOutputter * @throws JDOMException * @throws IOException */ private static void process(String fileName) throws JDOMException, IOException { System.out.println("JDOMDemo.process(): starting file " + fileName); SAXBuilder saxBuilder = new SAXBuilder(); Document jdomDocument = saxBuilder.build(fileName); DOMOutputter domOutputter = new DOMOutputter(); domOutputter.output(jdomDocument); }
public static NodeSet buildExtentPagesNodeSet(String input) throws JDOMException { Element extent = buildExtentPages(input); org.w3c.dom.Element domElement = new DOMOutputter().output(extent); NodeSet nodeSet = new NodeSet(); nodeSet.addNode(domElement); return nodeSet; } }
/** * Creates a W3C DOM document for the given WireFeed. * <p> * This method does not use the feed encoding property. * <p> * NOTE: This method delages to the 'Document WireFeedOutput#outputJDom(WireFeed)'. * <p> * * @param feed Abstract feed to create W3C DOM document from. The type of the WireFeed must * match the type given to the FeedOuptut constructor. * @return the W3C DOM document for the given WireFeed. * @throws IllegalArgumentException thrown if the feed type of the WireFeedOutput and WireFeed * don't match. * @throws FeedException thrown if the W3C DOM document for the feed could not be created. * */ public org.w3c.dom.Document outputW3CDom(final WireFeed feed) throws IllegalArgumentException, FeedException { final Document doc = outputJDom(feed); final DOMOutputter outputter = new DOMOutputter(); try { return outputter.output(doc); } catch (final JDOMException jdomEx) { throw new FeedException("Could not create DOM", jdomEx); } }
/** * Creates a W3C DOM document for the given WireFeed. * <p> * This method does not use the feed encoding property. * <p> * NOTE: This method delages to the 'Document WireFeedOutput#outputJDom(WireFeed)'. * <p> * * @param feed Abstract feed to create W3C DOM document from. The type of the WireFeed must * match the type given to the FeedOuptut constructor. * @return the W3C DOM document for the given WireFeed. * @throws IllegalArgumentException thrown if the feed type of the WireFeedOutput and WireFeed * don't match. * @throws FeedException thrown if the W3C DOM document for the feed could not be created. * */ public org.w3c.dom.Document outputW3CDom(final WireFeed feed) throws IllegalArgumentException, FeedException { final Document doc = outputJDom(feed); final DOMOutputter outputter = new DOMOutputter(); try { return outputter.output(doc); } catch (final JDOMException jdomEx) { throw new FeedException("Could not create DOM", jdomEx); } }
/** * Creates a W3C DOM document for the given WireFeed. * <p> * This method does not use the feed encoding property. * <p> * NOTE: This method delages to the 'Document WireFeedOutput#outputJDom(WireFeed)'. * <p> * @param feed Abstract feed to create W3C DOM document from. The type of the WireFeed must match * the type given to the FeedOuptut constructor. * @return the W3C DOM document for the given WireFeed. * @throws IllegalArgumentException thrown if the feed type of the WireFeedOutput and WireFeed don't match. * @throws FeedException thrown if the W3C DOM document for the feed could not be created. * */ public org.w3c.dom.Document outputW3CDom(WireFeed feed) throws IllegalArgumentException,FeedException { Document doc = outputJDom(feed); DOMOutputter outputter = new DOMOutputter(); try { return outputter.output(doc); } catch (JDOMException jdomEx) { throw new FeedException("Could not create DOM",jdomEx); } }
/** * Creates a W3C DOM document for the given WireFeed. * <p> * This method does not use the feed encoding property. * <p> * NOTE: This method delages to the 'Document WireFeedOutput#outputJDom(WireFeed)'. * <p> * @param feed Abstract feed to create W3C DOM document from. The type of the WireFeed must match * the type given to the FeedOuptut constructor. * @return the W3C DOM document for the given WireFeed. * @throws IllegalArgumentException thrown if the feed type of the WireFeedOutput and WireFeed don't match. * @throws FeedException thrown if the W3C DOM document for the feed could not be created. * */ public org.w3c.dom.Document outputW3CDom(WireFeed feed) throws IllegalArgumentException,FeedException { Document doc = outputJDom(feed); DOMOutputter outputter = new DOMOutputter(); try { return outputter.output(doc); } catch (JDOMException jdomEx) { throw new FeedException("Could not create DOM",jdomEx); } }
@Override public org.w3c.dom.Document merge(org.w3c.dom.Document[] sources) throws AbstractXmlMergeException { DOMBuilder domb = new DOMBuilder(); // to save all XML files as JDOM objects Document[] docs = new Document[sources.length]; for (int i = 0; i < sources.length; i++) { // ask JDOM to parse the given inputStream docs[i] = domb.build(sources[i]); } Document result = doMerge(docs); DOMOutputter outputter = new DOMOutputter(); try { return outputter.output(result); } catch (JDOMException e) { throw new DocumentException(result, e); } }
})) .forEach(e::addContent); return new DOMOutputter().output(e).getElementsByTagName("service");