| | |
parsing html
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Mar 2006
Posts: 1
Reputation:
Solved Threads: 0
Hi,
I am getting a javax.swing.text.ChangedCharSetException when I use the following code. Where do I set the prperty that you are talking about? ( I have a meta tag that is causing the exception.
try {
Reader r = new FileReader("PJMData.htm");
ParserDelegator parser = new ParserDelegator();
HTMLEditorKit.ParserCallback callback = new PJMParser();
parser.parse(r, callback, false);
} catch (IOException e) {
e.printStackTrace();
}
Let me know. Thanks.
I am getting a javax.swing.text.ChangedCharSetException when I use the following code. Where do I set the prperty that you are talking about? ( I have a meta tag that is causing the exception.
try {
Reader r = new FileReader("PJMData.htm");
ParserDelegator parser = new ParserDelegator();
HTMLEditorKit.ParserCallback callback = new PJMParser();
parser.parse(r, callback, false);
} catch (IOException e) {
e.printStackTrace();
}
Let me know. Thanks.
•
•
Join Date: Mar 2004
Posts: 802
Reputation:
Solved Threads: 40
I'm not sure in your case, since you're using the parser callback whereas I read the html into a document. The property I mentioned is set on the document itself.
doc.putProperty("IgnoreCharsetDirective", new Boolean(true));
Could you read your htm file into a document first then use the parser on it?
doc.putProperty("IgnoreCharsetDirective", new Boolean(true));
Could you read your htm file into a document first then use the parser on it?
![]() |
Similar Threads
- Parsing html form. (PHP)
Other Threads in the Java Forum
- Previous Thread: Drag and Drop headaches
- Next Thread: Topic -gui
Views: 8720 | Replies: 12
| Thread Tools | Search this Thread |
Tag cloud for Java
android api apple applet application applications arguments array arrays automation bank binary bluetooth chat class classes clear client code codesnippet component database db development dice draw ebook eclipse error event exception file formatingtextintooltipjava fractal game givemetehcodez graphics gui helpwithhomework html ide image infinite input integer invokingapacheantprogrammatically j2me jarfile java javaprojects jmf jni jpanel julia linux list loop map method methods mobile netbeans newbie number object openjavafx oracle parameter print problem program programming project recursion repositories scanner screen scrollbar server set size sms socket sort sorting sql sqlserver state storm string superclass swing swt test text-file threads time transfer tree windows






