In my startElement handler, Im trying to store the Attributes/AttributeList, but Im getting weird results. Whats going on?
You probably have a handler like this: public void startElement (String name, AttributeList attrs) throws SAXException { my_attr = attrs; } The problem is the SAX framework, in order to be as efficient as possible, will reuse that attrs object which you have a reference to. In order to get around this problem you need to make a persistant copy of the AttributeList or Attributes object. Look in the docs at the AttributesImpl and AttributeListImpl classes to see how to do this. Back to top…