@Override
    public void startElement(String name, Attributes attr) {
        allTags.add(bodyFlag ?name:null);
        if (bodyFlag && isPrint(name,attr)) {
            for (int i=0;i<tagPos;i++){
                System.out.print(" ");
            }
            System.out.print("<" + name);
            for (int i = 0; i < attr.getLength(); i++) {
                System.out.print(" " + attr.getName(i) + "=" + attr.getValue(i));
            }
            System.out.println(">");
            if (name.indexOf("br")==-1){
                tagPos++;
            }
        }
    }