Guest User

Untitled

a guest
Jan 20th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. final ByteArrayOutputStream out = new ByteArrayOutputStream();
  2. InputStream in = null;
  3. InputStream xsl = null;
  4. try {
  5. in = inputFileStream;
  6. xsl = url.openStream();
  7. final TransformerFactory tFactory = TransformerFactory
  8. .newInstance();
  9. final Transformer transformer = tFactory
  10. .newTransformer(new StreamSource(xsl));
  11. transformer.transform(new StreamSource(in), new StreamResult(out));
  12. } catch (Throwable t) {
  13. Activator.logErrorMessage(NLS.bind(
  14. Messages.Import_XSLT_TRANSFORMATION_FAILED, t.toString()));
  15. } finally {
  16. IOUtils.closeQuietly(xsl);
  17. IOUtils.closeQuietly(in);
  18. IOUtils.closeQuietly(out);
  19. }
  20.  
  21. final Transformer transformer = templates.newTransformer();
  22. transformer.setParameter("containerFullPath", containerFullPath);
  23. transformer.transform(new StreamSource(in), new StreamResult(out));
  24.  
  25. <xsl:param name="containerFullPath"/> <!-- at the root of the xslt -->
  26. ...
  27. <redirect:write file="{$containerFullPath}/{$modelName}-{@name}.bpmn">
  28. ...
Add Comment
Please, Sign In to add comment