1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
| public void Transform (StreamSource styleSource){
Htmlcorrection cr = new Htmlcorrection(url);
cr.ToXml(this.Result+"/input.xml");
File result = new File(this.Result+"/Finalresult.xml");
File res = new File(this.Result+"/input.xml");
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
try {
DocumentBuilder builder = factory.newDocumentBuilder();
Document doc = builder.parse(res);
TransformerFactory transformFactory = TransformerFactory.newInstance();
Transformer transform = transformFactory.newTransformer(styleSource);
DOMSource in = new DOMSource(doc);
StreamResult result1 = new StreamResult (result);
transform.transform(in, result1);
this.FinalResult=builder.parse(result);
}
catch (Exception e)
{
e.printStackTrace();
}
Genrator gn =new Genrator(this.FinalResult, this.url, this.Configuration);
gn.open(); |