@Test public void testGenerateWsdl() throws Exception { Document iddDoc = XmlUtil.parse( Files.fromResource("SomeService.xml"), Files.initResolver(mock(Log.class))); File xslFile = Files.fromResource("test-wsdl.xsl"); File outFile = new File(Files.baseDir, "target/wrk/SomeService.wsdl"); outFile.getParentFile().mkdirs(); XmlGenerator generator = new XmlGenerator(); generator.transform(iddDoc, xslFile, outFile); String expectedContent = Files.readFile(Files.fromResource("SomeService.wsdl")).replace("\r","").replace("\n",""); String actualContent = Files.readFile(outFile).replace("\r","").replace("\n",""); assertEquals(expectedContent, actualContent); }
public void transform(Document iddDoc, File xslFile, File outputFile) throws Exception { DOMSource source = new DOMSource(iddDoc); Source xslSource = new StreamSource(xslFile); TransformerFactory factory = TransformerFactory.newInstance(); Transformer trans = factory.newTransformer(xslSource); trans.transform(source, new StreamResult(new FileOutputStream(outputFile))); }
XmlGenerator { public void transform(Document iddDoc, File xslFile, File outputFile) throws Exception { DOMSource source = new DOMSource(iddDoc); Source xslSource = new StreamSource(xslFile); TransformerFactory factory = TransformerFactory.newInstance(); Transformer trans = factory.newTransformer(xslSource); trans.transform(source, new StreamResult(new FileOutputStream(outputFile))); } }
XmlGenerator { public void transform(Document iddDoc, File xslFile, File outputFile) throws Exception { DOMSource source = new DOMSource(iddDoc); Source xslSource = new StreamSource(xslFile); TransformerFactory factory = TransformerFactory.newInstance(); Transformer trans = factory.newTransformer(xslSource); trans.transform(source, new StreamResult(new FileOutputStream(outputFile))); }  }
XmlGenerator { public void transform(Document iddDoc, File xslFile, File outputFile) throws Exception { DOMSource source = new DOMSource(iddDoc); Source xslSource = new StreamSource(xslFile); TransformerFactory factory = TransformerFactory.newInstance(); Transformer trans = factory.newTransformer(xslSource); trans.transform(source, new StreamResult(new FileOutputStream(outputFile))); }  void transform(Document iddDoc, File xslFile, File outputFile); }
XmlGenerator { public void transform(Document iddDoc, File xslFile, File outputFile) throws Exception { DOMSource source = new DOMSource(iddDoc); Source xslSource = new StreamSource(xslFile); TransformerFactory factory = TransformerFactory.newInstance(); Transformer trans = factory.newTransformer(xslSource); trans.transform(source, new StreamResult(new FileOutputStream(outputFile))); }  void transform(Document iddDoc, File xslFile, File outputFile);  }