contentHandler.endPrefixMapping(streamReader.getNamespaceURI(i));
    protected void parse() throws SAXException {        try {            contentHandler.startDocument();            while (true) {                switch (streamReader.getEventType()) {                case XMLStreamConstants.ATTRIBUTE:                case XMLStreamConstants.CDATA:                    break;                case XMLStreamConstants.CHARACTERS:                    if (!streamReader.isWhiteSpace()) {                        for (int textLength = streamReader.getTextLength(); textLength > 0; textLength -= chars.length) {                            int l = Math.min(textLength, chars.length);                            streamReader.getTextCharacters(0, chars, 0, l);                            contentHandler.characters(chars, 0, l);                        }                    }                    break;                case XMLStreamConstants.COMMENT:                case XMLStreamConstants.DTD:                    break;                case XMLStreamConstants.END_DOCUMENT:                    contentHandler.endDocument();                    return;                case XMLStreamConstants.END_ELEMENT: {                    String uri = streamReader.getNamespaceURI();                    String localName = streamReader.getLocalName();                    String prefix = streamReader.getPrefix();                    String qname = prefix != null && prefix.length() > 0 ? prefix + ":" + localName : localName;                    contentHandler.endElement(uri, localName, qname);                    for (int i = 0; i < streamReader.getNamespaceCount(); i++) {                        contentHandler.endPrefixMapping(streamReader.getNamespaceURI(i));                    }                    break;                }                case XMLStreamConstants.ENTITY_DECLARATION:                case XMLStreamConstants.ENTITY_REFERENCE:                case XMLStreamConstants.NAMESPACE:                case XMLStreamConstants.NOTATION_DECLARATION:                case XMLStreamConstants.PROCESSING_INSTRUCTION:                case XMLStreamConstants.SPACE:                case XMLStreamConstants.START_DOCUMENT:                    break;                case XMLStreamConstants.START_ELEMENT: {                    // Do not use startPrefixMapping                    // See comment in getAttributes                    // for (int i = 0; i < streamReader.getNamespaceCount();                    // i++) {                    // contentHandler.startPrefixMapping(streamReader.getNamespacePrefix(i),                    // streamReader.getNamespaceURI(i));                    // }                    String uri = streamReader.getNamespaceURI();                    String localName = streamReader.getLocalName();                    String prefix = streamReader.getPrefix();                    String qname = prefix != null && prefix.length() > 0 ? prefix + ":" + localName : localName;                    contentHandler.startElement(uri, localName, qname, getAttributes());                    break;                }                }                streamReader.next();            }        } catch (XMLStreamException e) {            throw new SAXParseException(e.getMessage(), null, null, e.getLocation().getLineNumber(), e.getLocation()                    .getColumnNumber(), e);        }    }