Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在java中对XML数据应用一个或多个XSLT样式表_Java_Xml_Xslt - Fatal编程技术网

在java中对XML数据应用一个或多个XSLT样式表

在java中对XML数据应用一个或多个XSLT样式表,java,xml,xslt,Java,Xml,Xslt,我希望能够对xml数据应用一个或多个sytle表。我有这段代码,我想知道如何修改它,以便在一个xml数据上应用尽可能多的样式表,并将结果打印在GUI的文本区域(我假定settext()只接受字符串),同时保存在文件中。这是我的密码。。多谢各位 /** * Constructor for objects of class Simple */ public Simple(String xmlFile, String xslFile,String outputFile)

我希望能够对xml数据应用一个或多个sytle表。我有这段代码,我想知道如何修改它,以便在一个xml数据上应用尽可能多的样式表,并将结果打印在GUI的文本区域(我假定settext()只接受字符串),同时保存在文件中。这是我的密码。。多谢各位

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

  public String SimpleTransform() 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 = "***The result is in birds.out *****";
 } 
 }

您需要转换过滤器链:阅读