InterviewSolution
| 1. |
How Do I Associate My Own Data With A Node In The Dom Tree? |
|
Answer» The class org.apache.xerces.dom.NodeImpl provides a VOID setUserData(Object o) and an Object getUserData() method that you can use to attach any object to a node in the DOM tree. BEWARE that you should try and remove references to your data on nodes you no longer use (by calling setUserData(null), or these nodes will not be GARBAGE collected until the WHOLE document is. The class org.apache.xerces.dom.NodeImpl provides a void setUserData(Object o) and an Object getUserData() method that you can use to attach any object to a node in the DOM tree. Beware that you should try and remove references to your data on nodes you no longer use (by calling setUserData(null), or these nodes will not be garbage collected until the whole document is. |
|