private Attributes filterAttributes(Attributes atts) throws SAXException {
        int length = atts.getLength();
        int i = 0;
        while (i < length) {
            if (isInNamespacesToRemove(atts.getURI(i))) {
                if (!alreadyWarnedAboutFiltering) {
                    warning(new SAXParseException(
                            "Content is being hidden from the validator based on namespace filtering.",
                            locator));
                    alreadyWarnedAboutFiltering = true;
                }
                AttributesImpl rv = new AttributesImpl();
                for (int j = 0; j < i; j++) {
                    rv.addAttribute(atts.getURI(j), atts.getLocalName(j),
                            atts.getQName(j), atts.getType(j), atts.getValue(j));
                }
                i++;
                while (i < length) {
                    String uri = atts.getURI(i);
                    if (!isInNamespacesToRemove(uri)) {
                        rv.addAttribute(uri, atts.getLocalName(i),
                                atts.getQName(i), atts.getType(i),
                                atts.getValue(i));
                    }
                    i++;
                }
                return rv;
            }
            i++;
        }
        return atts;
    }
@see org.xml.sax.helpers.XMLFilterImpl#startElement(java.lang.String,
     java.lang.String, java.lang.String, org.xml.sax.Attributes)
src/nu/validator/xml/NamespaceDroppingXMLReaderWrapper.java