public void endElement(String uri, String localName, String qName) throws SAXException { super.endElement(uri, localName, qName); eventFactory.setLocation(getCurrentLocation()); // parse name String[] qname = {null, null}; parseQName(qName, qname); // get namespaces Collection nsList = (Collection) namespaceStack.remove(namespaceStack.size() - 1); Iterator nsIter = nsList.iterator(); try { consumer.add(eventFactory.createEndElement(qname[0], uri, qname[1], nsIter)); } catch (XMLStreamException e) { throw new SAXException(e); } }
for (int i = 0, s = attributes.getLength(); i < s; i++) { parseQName(attributes.getQName(i), qname);
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); } }