public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { // set document location eventFactory.setLocation(getCurrentLocation()); // create attribute and namespace events Collection[] events = {null, null}; createStartEvents(attributes, events); // save a reference to the namespace collection so we can use them // again // in the end element namespaceStack.add(events[0]); try { String[] qname = {null, null}; parseQName(qName, qname); consumer.add(eventFactory.createStartElement(qname[0], uri, qname[1], events[1].iterator(), events[0].iterator())); } catch (XMLStreamException e) { throw new SAXException(e); } finally { super.startElement(uri, localName, qName, attributes); } }