@Override
    public void startElement(String arg0, String arg1, String arg2,
            Attributes attrs) throws SAXException {
        ensureState();
        level++;
        if (omitRoot && level == 1) {
            return;
        }
        try {
            w.write("__attrs__.clear();\n");
            for (int i = 0; i < attrs.getLength(); i++) {
                w.write("__attrs__.addAttribute(");
                w.write(stringLiteral(attrs.getURI(i)));
                w.write(", ");
                w.write(stringLiteral(attrs.getLocalName(i)));
                w.write(", ");
                w.write(stringLiteral(attrs.getQName(i)));
                w.write(", ");
                w.write(stringLiteral(attrs.getType(i)));
                w.write(", ");
                w.write(stringLiteral(attrs.getValue(i)));
                w.write(");\n");
            }
            w.write("contentHandler.startElement(");
            w.write(stringLiteral(arg0));
            w.write(", ");
            w.write(stringLiteral(arg1));
            w.write(", ");
            w.write(stringLiteral(arg2));
            w.write(", __attrs__);\n");
        } catch (IOException e) {
            throw new SAXException(e);
        }
    }
@see org.xml.sax.ContentHandler#startElement(java.lang.String,
     java.lang.String, java.lang.String, org.xml.sax.Attributes)
src/nu/validator/xml/SaxCompiler.java