0

我有一个进行简单转换的对象。我创建了一个将 XML 数据转换为 CSV 的样式表。转换后,将创建一个 CSV 文件,但内容为空。

public class Simplex
 {

private String xmlFile ;
private String xslFile;
private String  outputFile;


/**
 * Constructor for objects of class Simple
 */
   public Simplex(String xmlFile, String xslFile,String outputFile)
  {
   this.xmlFile = xmlFile;
    this.xslFile = xslFile;
   this.outputFile= outputFile;
  }

 public String simplexTransform() throws    
TransformerException,TransformerConfigurationException,FileNotFoundException,
IOException

  {String mystring = "";

  TransformerFactory tFactory = TransformerFactory.newInstance();
 Transformer transformer = tFactory.newTransformer(new StreamSource(xslFile));
 transformer.transform(new StreamSource(xmlFile), new StreamResult(new    
FileOutputStream(outputFile)));
  return mystring = "*Data Has Been Transformed,Check ouput File *";
  } 
}
4

0 回答 0