Is there anyway to convert an instance of org.w3c.dom.Document to org.apache.html.dom.HTMLDocumentImpl.
I need to parse the images inside the Document and HTMLDocumentImpl has a method for extracting the images.
I’ve tried several methods like typecasting, and importNode but it doesn’t work.
Since you said you tried casting, I’ll assume that the
Documentinstance you have is not aorg.apache.html.dom.HTMLDocumentImpl. Two things that might be worth a shot:1) The
getImages()method is in fact defined on the interfaceorg.w3c.dom.html.HTMLDocument, which is more likely to be implemented by whatever type of Dom document you have. Thus, you should be able to do something like:2) If that doesn’t work, the
getImages()method is really not going to do anything much fancier than: