Assume you have a org.xml.sax.ContentHandler
implementation, considering the call of the
If you have now several calls to this method, the
Object in the atts parameter (of type Attributes) is
every time the reference to the same Object which is
That is, if you save these references while
experiencing several startElement events, every saved
reference will point to the same object (which will
then contain the last set of attributes perceived).
As a workaround, when working like this, you currently
need to clone the set of attributes you wish to save;
this behaviour is absolutely counterproductive.
Log in to post a comment.