I am using NekoHTML framework with xerces 2.11.0 version to parse an HTML document. But i am having a problem with this simple code :
DOMParser parser = new DOMParser();
System.out.println(parser.getClass().toString());
InputSource url = new InputSource("http://www.cbgarden.org");
try{
parser.parse(url);
Document document = parser.getDocument();
System.out.println(document.hasChildNodes());
System.out.println(document.getBaseURI());
System.out.println(document.getNodeName());
System.out.println(document.getNodeValue());
}catch(Exception e){
e.printStackTrace();
}
Now I put here the result of the multiple prints:
- class org.cyberneko.html.parsers.DOMParser
- true
- http://www.cbgarden.org
- document
- null
So my question is : What could be wrong ? No exception is thrown and I am following the rules that are defined in the usage rules in the NekoHTML. My build path libraries are with this precedence:
- nekohtml.jar
- nekohtmlSamples.jar
- xercesImpl.jar
- xercesSamples.jar
- xml-apis.jar