- Create an instance - call a using* to set the XSL - call a from* to set the source XML - call a to* to make the transformation and store the XML
828384858687888990
StreamsUtils.flowStream(inputStream, zos); // Close zos.closeEntry(); } catch (IOException e) { throw new StLightException("Problem creating the zip file", e); } }
106107108109110111112113
*/ public void close() { try { zos.close(); } catch (IOException e) { throw new StLightException("Problem closing the zip file", e); } }
7576777879808182
public XslTransformation fromFile(File xmlFile) { try { fromXml = new StreamSource(xmlFile); return this; } catch (Exception e) { throw new StLightException(e); } }
9091929394959697
*/ public XslTransformation fromFile(String xmlPathName) { try { return fromInputStream(new FileInputStream(xmlPathName)); } catch (Exception e) { throw new StLightException(e); } }
140141142143144145146147
public XslTransformation fromUrl(String xmlUrl) { try { fromXml = new StreamSource(xmlUrl); return this; } catch (Exception e) { throw new StLightException(e); } }
156157158159160161162163
assertFields(); try { StreamResult out = new StreamResult(xmlFile); transformer.transform(fromXml, out); } catch (Exception e) { throw new StLightException(e); } }
171172173174175176177178
public void toFile(String xmlPathName) { assertFields(); try { toOutputStream(new FileOutputStream(xmlPathName)); } catch (Exception e) { throw new StLightException(e); } }
187188189190191192193194
assertFields(); try { StreamResult out = new StreamResult(xmlOutputStream); transformer.transform(fromXml, out); } catch (Exception e) { throw new StLightException(e); } }
203204205206207208209210
try { ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); toOutputStream(outputStream); return new String(outputStream.toByteArray()); } catch (Exception e) { throw new StLightException(e); } }
219220221222223224225226
assertFields(); try { StreamResult out = new StreamResult(xmlWriter); transformer.transform(fromXml, out); } catch (Exception e) { throw new StLightException(e); } }