|
News
|
| |
21/1/2008
Mozilla Java Html Parser v.0.2.0 released
|
|
| |
|
Four (more or less) easy steps to integrate Mozilla parser
into your code :
-
Download
And include the source code
-
Insert both the dist/bin and the dist/bin/components
directories to the right enviroment variable.
On windows it is PATH variable and you can manipulate it threw
Start->ControlPanel->System->Advanced->Enviroment Vairables
On Linux you should add it to LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/dist/bin:/path/to/dist/bin/components
On MacOSX you should add it to DYLD_LIBRARY_PATH
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/path/to/dist/bin:/path/to/dist/bin/components
I know it's a pain , but it's the only way I managed to do it. if someone
happens to be smarter than I , please send me a note.
-
include this code in your code. You can find it on
com.dappit.Dapper.parser.example.ParserExample :
File parserLibraryFile = new File("./native/bin/MozillaParser" + EnviromentController.getSharedLibraryExtension());
String parseLibrary = parserLibraryFile.getAbsolutePath();
MozillaParser.init(parseLibrary, "C:\\dapper\\mozilla\\dist\\bin");
Document domDocument = MozillaParser.getInstance().parse("<html>Hello
world!</html>");
MozillaParser.getInstance().stopRunning();
-
You can include junit into your jars and run the Unit test for
checks (TestMozillaParser)
|