title: Java: Jtidy convertion from html text to xhtml text
body: <p>I am using JTidy i want to give it a string as an input instead of a file. Is that possible?
  How i can do that?</p>
  
  <p>This is my code: </p>
  
  <pre><code>    FileInputStream fis =null;  
      String htmlFileName = "report.html";  
  
     //from html to xhtml
     try   
      {  
          fis = new FileInputStream(htmlFileName);  
      }  
      catch (java.io.FileNotFoundException e)   
      {  
          System.out.println("File not found: " + htmlFileName);  
      }  
          Tidy tidy = new Tidy(); 
          tidy.setShowWarnings(false);
          tidy.setXmlTags(false);
          tidy.setInputEncoding("UTF-8");
          tidy.setOutputEncoding("UTF-8");
          tidy.setXHTML(true);// 
          tidy.setMakeClean(true);
          Document xmlDoc = tidy.parseDOM(fis, null);  
      try  
      {  
          tidy.pprint(xmlDoc,new FileOutputStream("report.xhtml"));  
      }  
  </code></pre>