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();        try {            //org.apache.xpath.objects.XObject xo = XPathAPI.eval(doc.getDocumentElement(), "//xh:style[@type='text/css']", pres);            //NOTE: type is required and we only handle css            org.apache.xpath.objects.XObject xo = XPathAPI.eval(doc.getDocumentElement(), "//style[@type='text/css']");            org.w3c.dom.NodeList nl = xo.nodelist();            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 assumes "all"                StylesheetInfo info = new StylesheetInfo();                info.setMedia(m);                info.setType(elem.getAttribute("type"));//I'd be surprised if this was not text/css!                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.getNodeType() == org.w3c.dom.Node.TEXT_NODE) {                        style.append(txt.getNodeValue());                    }                }                InlineStyleInfo isi = new InlineStyleInfo();                isi.setInfo(info);                isi.setStyle(style.toString());                list.add(isi);            }        } catch (Exception ex) {            ex.printStackTrace();        }        InlineStyleInfo[] infos = new InlineStyleInfo[list.size()];        for (int i = 0; i < infos.length; i++) {            infos[i] = (InlineStyleInfo) list.get(i);        }        return infos;    }