@Override
    public void startElement(String uri, String localName, String qName,
            Attributes atts) throws SAXException {
        if (contentHandler == null) {
            return;
        }
        if ("http://www.w3.org/1999/xhtml" == uri) {
            if (("input" == localName || "command" == localName) && atts.getIndex("", "type") > 0) {
                PermutingAttributesWrapper wrap = new PermutingAttributesWrapper(atts);
                wrap.pullUp("", "role");
                wrap.pullUp("", "type");
                wrap.pullUp("", "template");                
                contentHandler.startElement(uri, localName, qName, wrap);                
            } else if ("textarea" == localName && atts.getIndex("", "wrap") > 0) {
                PermutingAttributesWrapper wrap = new PermutingAttributesWrapper(atts);
                wrap.pullUp("", "wrap");
                wrap.pullUp("", "template");                
                contentHandler.startElement(uri, localName, qName, wrap);                
            } else if ("script" == localName && atts.getIndex("", "src") > 0) {
                PermutingAttributesWrapper wrap = new PermutingAttributesWrapper(atts);
                wrap.pullUp("", "src");
                wrap.pullUp("", "template");                
                contentHandler.startElement(uri, localName, qName, wrap);                
            } else if ("meta" == localName && atts.getIndex("", "content") < atts.getLength() - 1) {
                PermutingAttributesWrapper wrap = new PermutingAttributesWrapper(atts);
                wrap.pushDown("", "content");
                wrap.pullUp("", "template");                
                contentHandler.startElement(uri, localName, qName, wrap);                
            } else if (atts.getIndex("", "template") > 0 || atts.getIndex("", "role") > 0) {
                PermutingAttributesWrapper wrap = new PermutingAttributesWrapper(atts);
                wrap.pullUp("", "role");
                wrap.pullUp("", "template");                
                contentHandler.startElement(uri, localName, qName, wrap);                                
            } else {
                contentHandler.startElement(uri, localName, qName, atts);                
            }
        } else {
            contentHandler.startElement(uri, localName, qName, 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/AttributesPermutingXMLReaderWrapper.java