TRANSFORMATIONS.put(EHCACHE_CACHE1X, "xslt/ehcache1x2infinispan4x.xslt");
TRANSFORMATIONS.put(COHERENCE_35X, "xslt/coherence35x2infinispan4x.xslt");
}
public void parse(InputStream is, OutputStream os, String xsltFile) throws Exception {
InputStream xsltInStream = new FileLookup().lookupFile(xsltFile);
if (xsltInStream == null) {
throw new IllegalStateException("Cold not find xslt file! : " + xsltFile);
}
try {
Document document = getInputDocument(is);
// Use a Transformer for output
Transformer transformer = getTransformer(xsltInStream);
DOMSource source = new DOMSource(document);
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
StreamResult result = new StreamResult(byteArrayOutputStream);
transformer.transform(source, result);
InputStream indentation = new FileLookup().lookupFile("xslt/indent.xslt");
try {
// Use a Transformer for output
transformer = getTransformer(indentation);
StreamResult finalResult = new StreamResult(os);
StreamSource rawResult = new StreamSource(new ByteArrayInputStream(byteArrayOutputStream.toByteArray()));