@Test public void testToOutputStream() throws Exception { ByteArrayOutputStream os = new ByteArrayOutputStream(); classUnderTestMoreNodes.toOutputStream(os); byte[] bytes = os.toByteArray(); String bytesStr = new String(bytes); assertXMLEqual(bytesStr, classUnderTestMoreNodes.toString()); assertXMLNotEqual(bytesStr, classUnderTest.toString()); }
public void toOutputStream(OutputStream os) throws XmlException { try { TransformerFactory transformerFactory = TransformerFactory.newInstance(); Transformer transformer = transformerFactory.newTransformer(); transformer.transform(new DOMSource(doc), new StreamResult(os)); } catch (TransformerException e) { throw new XmlException(e); } }
Xml { public void toOutputStream(OutputStream os) throws XmlException { try { TransformerFactory transformerFactory = TransformerFactory.newInstance(); Transformer transformer = transformerFactory.newTransformer(); transformer.transform(new DOMSource(doc), new StreamResult(os)); } catch (TransformerException e) { throw new XmlException(e); } } }
Xml { public void toOutputStream(OutputStream os) throws XmlException { try { TransformerFactory transformerFactory = TransformerFactory.newInstance(); Transformer transformer = transformerFactory.newTransformer(); transformer.transform(new DOMSource(doc), new StreamResult(os)); } catch (TransformerException e) { throw new XmlException(e); } } Xml(String source);  Xml(InputStream source);  Xml(Document doc); }
Xml { public void toOutputStream(OutputStream os) throws XmlException { try { TransformerFactory transformerFactory = TransformerFactory.newInstance(); Transformer transformer = transformerFactory.newTransformer(); transformer.transform(new DOMSource(doc), new StreamResult(os)); } catch (TransformerException e) { throw new XmlException(e); } } Xml(String source);  Xml(InputStream source);  Xml(Document doc); String getValue(String xpath); NodeList getNodes(String xpath); Node addNode(Node parent, String newNode); void removeNodes(String xpath); @Override String toString(); String toString(String xpath); String toPrettyString(String xpath); static Node addNodeIfNotPresent(Node parent, String newNode); static NodeList getNodes(Node node, String xpath); static Node getFirstNode(Node node, String xpath); String getAttributeValue(String xpathToNode, String attribName); static String getAttribute(Node node, String name); int addNodeRecursively(InputStream newXml, String xpath, boolean addDuplicates); static boolean contains(NodeList list, Node node); Document getDocument(); void toOutputStream(OutputStream os); }
Xml { public void toOutputStream(OutputStream os) throws XmlException { try { TransformerFactory transformerFactory = TransformerFactory.newInstance(); Transformer transformer = transformerFactory.newTransformer(); transformer.transform(new DOMSource(doc), new StreamResult(os)); } catch (TransformerException e) { throw new XmlException(e); } } Xml(String source);  Xml(InputStream source);  Xml(Document doc); String getValue(String xpath); NodeList getNodes(String xpath); Node addNode(Node parent, String newNode); void removeNodes(String xpath); @Override String toString(); String toString(String xpath); String toPrettyString(String xpath); static Node addNodeIfNotPresent(Node parent, String newNode); static NodeList getNodes(Node node, String xpath); static Node getFirstNode(Node node, String xpath); String getAttributeValue(String xpathToNode, String attribName); static String getAttribute(Node node, String name); int addNodeRecursively(InputStream newXml, String xpath, boolean addDuplicates); static boolean contains(NodeList list, Node node); Document getDocument(); void toOutputStream(OutputStream os);  }