InlineStyleInfo isi = new InlineStyleInfo(); isi.setInfo(info); isi.setStyle(style.toString()); list.add(isi);
    public InlineStyleInfo[] getInlineStyle(org.w3c.dom.Document doc) {        List list = new ArrayList();        org.w3c.dom.NodeList nl = null;        Element html = doc.getDocumentElement();        Element head = findFirstChild(html, "head");        if (head != null) {            nl = head.getElementsByTagName("style");        }        for (int i = 0, len = nl.getLength(); i < len; i++) {            StringBuffer style = new StringBuffer();            org.w3c.dom.Element elem = (org.w3c.dom.Element) nl.item(i);            String m = elem.getAttribute("media");            if ("".equals(m)) {                m = "all";            }//default for HTML is "screen", but that is silly and firefox seems to assume "all"            StylesheetInfo info = new StylesheetInfo();            info.setMedia(m);            info.setType(elem.getAttribute("type"));            info.setTitle(elem.getAttribute("title"));            info.setOrigin(StylesheetInfo.AUTHOR);            org.w3c.dom.NodeList children = elem.getChildNodes();            for (int j = 0; j < children.getLength(); j++) {                org.w3c.dom.Node txt = children.item(j);                if (txt instanceof CharacterData) {                    style.append(txt.getNodeValue());                }            }            InlineStyleInfo isi = new InlineStyleInfo();            isi.setInfo(info);            isi.setStyle(style.toString());            list.add(isi);        }        InlineStyleInfo[] infos = new InlineStyleInfo[list.size()];        for (int i = 0; i < infos.length; i++) {            infos[i] = (InlineStyleInfo) list.get(i);        }        return infos;    }