protected void writeAttributes(AttributeSet attr) throws IOException {
        // translate css attributes to html
        if (attr instanceof Element) {
            Element elem = (Element) attr;
            if (elem.isLeaf() || elem.getName().equalsIgnoreCase("p-implied")) {
                super.writeAttributes(attr);
                return;
            }
        }
        convAttr.removeAttributes(convAttr);
        convertToHTML(attr, convAttr);

        Enumeration names = convAttr.getAttributeNames();
        while (names.hasMoreElements()) {
            Object name = names.nextElement();
            if (name instanceof HTML.Tag || name instanceof StyleConstants
                    || name == HTML.Attribute.ENDTAG) {
                continue;
            }
            write(" " + name + "=\"" + convAttr.getAttribute(name) + "\"");
        }
    }