1 20 21 22 package org.openi.stat.r; 23 24 import java.util.Map ; 25 import java.io.File ; 26 import javax.xml.transform.stream.StreamSource ; 27 import javax.xml.transform.Source ; 28 29 import org.openi.xml.XMLTransformer; 30 import java.io.IOException ; 31 import javax.xml.transform.TransformerException ; 32 import org.openi.xml.BeanStorage; 33 import java.io.InputStream ; 34 import java.io.ByteArrayInputStream ; 35 36 43 44 public class RFunctionUIBuilder { 45 46 55 public static String build(RFunctionList funList, String xslFile, Map xslParam) throws 56 IOException , TransformerException { 57 58 BeanStorage storage = new BeanStorage(); 59 InputStream is = new ByteArrayInputStream ( storage.toXmlString(funList).getBytes()); 60 Source xml = new StreamSource (is); 61 Source xslt = new StreamSource (new File (xslFile)); 62 63 return XMLTransformer.transform(xslt, xml, xslParam); 64 65 } 66 67 } 68 | Popular Tags |