In java, how do I create my own xml subclassed elements in a DOM returned by 3rd party tools.

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.
Is something against you extend the already existing implementation provided by this HTMLCleaner library? Package privateness perhaps?

以上就是In java, how do I create my own xml subclassed elements in a DOM returned by 3rd party tools.的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏