X
Xavier
Hi,
I've just download Xerces2 Java and I'd like to parse an HTML file using
the HTMLDOMImplementation found in the org.apache.html.dom package.
First I try :
DOMImplementationRegistry registry =
DOMImplementationRegistry.newInstance();
DOMImplementation domImpl =
(DOMImplementation)registry.getDOMImplementation("HTML");
but it doesn't find any DOM Implementation for HTML.
Then I try :
HTMLDOMImplementation domImpl =
HTMLDOMImplementationImpl.getHTMLDOMImplementation();
DOMImplementationLS domImplLS =
(DOMImplementationLS)domImpl.getFeature("LS","3.0");
LSParser parser =
domImplLS.createLSParser(DOMImplementationLS.MODE_SYNCHRONOUS, null);
Document document = parser.parseURI("C:\\test.html");
but I don't know how to get an instance of HTMLDocument to use the HTML
DOM interfaces.
thks
I've just download Xerces2 Java and I'd like to parse an HTML file using
the HTMLDOMImplementation found in the org.apache.html.dom package.
First I try :
DOMImplementationRegistry registry =
DOMImplementationRegistry.newInstance();
DOMImplementation domImpl =
(DOMImplementation)registry.getDOMImplementation("HTML");
but it doesn't find any DOM Implementation for HTML.
Then I try :
HTMLDOMImplementation domImpl =
HTMLDOMImplementationImpl.getHTMLDOMImplementation();
DOMImplementationLS domImplLS =
(DOMImplementationLS)domImpl.getFeature("LS","3.0");
LSParser parser =
domImplLS.createLSParser(DOMImplementationLS.MODE_SYNCHRONOUS, null);
Document document = parser.parseURI("C:\\test.html");
but I don't know how to get an instance of HTMLDocument to use the HTML
DOM interfaces.
thks