So I'm using HTMLCleaner which returns a org.w3c.dom compatible DOM. Now, I want to insert my own subclassed Elements (which implement additional functionality outside the dom) into this dom tree. Is this possible?
If you use the Document.createElement(), you can't say that you want it to create your implementation of an element. Ideally I don't want my class to implement Element and Node have to manually do all the work that has already been done. I thought that I could subclass ElementImpl from Xerces and potentially add it to the DOM I have. However Xerces expects to be created into DOMs that implement CoreDocumentImpl etc.
It would be a pity, from an elegance point of view. If I had to use plain Element and manage to identify them by their attributes/names etc, as each one needs to point to particular positions in an index.