private void writeName(String uri, String localName, String qualifiedName) throws SAXException {
        try {
            if (uri == null || uri.length() == 0) {
                if (qualifiedName == null || qualifiedName.length() == 0) {
                    output.write(localName.getBytes("UTF-8"));
                } else {
                    output.write(qualifiedName.getBytes("UTF-8"));
                }
            } else if (localName == null || localName.length() == 0) {
                output.write(qualifiedName.getBytes("UTF-8"));
            } else {
                String prefix = stackedIndexPeek(prefixesByNamespaceURI, uri);
                if (prefix == null || prefix.length() == 0) {
                    output.write(localName.getBytes("UTF-8"));
                } else {
                    output.write(prefix.getBytes("UTF-8"));
                    output.write(":".getBytes("UTF-8"));
                    output.write(localName.getBytes("UTF-8"));
                }
            }
        } catch (Exception e) {
            throw new SAXException(e);
        }
    }