The following patch implements line numbering in HtmlCleaner and uses the setUserData/getUserData methods of org.w3c.dom.Node to ensure that line numbers are available within DOM trees (as Integer userdata).
This patch is hereby transferred released under the BSD license.
Some comments: Instead of having 4 separate Integer user data properties, one could have a single HtmlCleaner-specific DocumentLocation object, but this may not be desirable.
We considered also inserting some org.w3c.dom.ProcessorInstruction nodes into the DOM tree but decided that this was much less elegant.
the diff
Two new files which go with the patch
Logged In: YES
user_id=215018
Originator: YES
File Added: linenums_newfiles.diff