} else {
} else if (applies) {
    private int appendStylesheet(StylesheetInfo si, int count, java.util.TreeMap sorter, String media) {        if (!si.appliesToMedia(media)) return count;        Stylesheet ss = si.getStylesheet();        if (ss == null) {            ss = _styleFactory.getStylesheet(si);            si.setStylesheet(ss);        }        if (ss == null) return count;//couldn't load it        for (java.util.Iterator rulesets = ss.getRulesets(); rulesets.hasNext();) {            Object obj = rulesets.next();            if (obj instanceof StylesheetInfo) {                count = appendStylesheet((StylesheetInfo) obj, count, sorter, media);            } else {                org.xhtmlrenderer.css.sheet.Ruleset r = (org.xhtmlrenderer.css.sheet.Ruleset) obj;                //at this point all selectors in a ruleset must be placed on the descendant axis                org.w3c.css.sac.SelectorList selector_list = r.getSelectorList();                for (int i = 0; i < selector_list.getLength(); i++) {                    org.w3c.css.sac.Selector selector = selector_list.item(i);                    Selector s = addSelector(count++, r, selector);                    sorter.put(s.getOrder(), s);                }            }        }        return count;    }