K
k4
Hi
I have problem with JTidy, I can't return text between <p> xx </p> :/
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.w3c.tidy.Tidy;
public static void main(String[] args) {
try {
Tidy tdpr = new Tidy();
Document dc;
tdpr.setShowWarnings(false);
tdpr.setXHTML(true);
FileInputStream zoo = new FileInputStream("index.html");
BufferedInputStream in = new BufferedInputStream(zoo);
BufferedOutputStream out = new BufferedOutputStream(new
FileOutputStream("bar.html"));
dc = tdpr.parseDOM(in, null);
NodeList tag = dc.getElementsByTagName("p");
System.out.print(tag.getLength());
Node uchwyt = tag.item(0);
System.out.print(uchwyt.getFirstChild().getTextContent());
}catch (Exception z) {}
any idee ?
I have problem with JTidy, I can't return text between <p> xx </p> :/
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.w3c.tidy.Tidy;
public static void main(String[] args) {
try {
Tidy tdpr = new Tidy();
Document dc;
tdpr.setShowWarnings(false);
tdpr.setXHTML(true);
FileInputStream zoo = new FileInputStream("index.html");
BufferedInputStream in = new BufferedInputStream(zoo);
BufferedOutputStream out = new BufferedOutputStream(new
FileOutputStream("bar.html"));
dc = tdpr.parseDOM(in, null);
NodeList tag = dc.getElementsByTagName("p");
System.out.print(tag.getLength());
Node uchwyt = tag.item(0);
System.out.print(uchwyt.getFirstChild().getTextContent());
}catch (Exception z) {}
any idee ?