Menu

Need example adding node/element in DOM

Help
2016-01-13
2016-02-01
  • JavaDevTech

    JavaDevTech - 2016-01-13

    I have searched all over and I have not been a good example of HtmlCleaner creatting a NEW node element and inserting that new node element at a specifc place in the DOM but I cannot find an example. Could someone provide an example?

     
  • Scott Wilson

    Scott Wilson - 2016-02-01

    Hi Troy,

    The code here uses HtmlCleaner to inject a set of required scripts and stylesheets into existing HTML:

    http://svn.apache.org/repos/asf/wookie/trunk/wookie-server/src/main/java/org/apache/wookie/util/html/

    This is pretty trivial as it just needs to call headNode.addChild(). However injecting new nodes at other locations follows a similar pattern.

    HTH.

    S

     

Log in to post a comment.