info.setUri(uri);
info.setUri(baseUri);
    private List getStylesheets() {        java.io.Reader reader;        List infos = new LinkedList();        long st = System.currentTimeMillis();        String uri = _nsh.getNamespace();        StylesheetInfo info = new StylesheetInfo();        info.setUri(_nsh.getNamespace());        info.setOrigin(StylesheetInfo.USER_AGENT);        info.setMedia("all");        info.setType("text/css");        if (!_stylesheetFactory.containsStylesheet(uri)) {            reader = _nsh.getDefaultStylesheet();            if (reader != null) {                Stylesheet sheet = _stylesheetFactory.parse(reader, info);                _stylesheetFactory.putStylesheet(uri, sheet);            }        }        infos.add(info);        StylesheetInfo[] refs = _nsh.getStylesheetLinks(_doc);        if (refs != null) {            for (int i = 0; i < refs.length; i++) {                java.net.URL baseUrl = _context.getRenderingContext().getBaseURL();                try {                    uri = new java.net.URL(baseUrl, refs[i].getUri()).toString();                    refs[i].setUri(uri);                } catch (java.net.MalformedURLException e) {                    XRLog.exception("bad URL for associated stylesheet", e);                }            }        }        infos.addAll(Arrays.asList(refs));        String baseUri = _context.getRenderingContext().getBaseURL().toString();        uri = baseUri + "?-fs-media-?" + _context.media;        info = new StylesheetInfo();        info.setUri(uri);        info.setType("text/css");        info.setOrigin(StylesheetInfo.AUTHOR);        info.setMedia(_context.media);        if (!_stylesheetFactory.containsStylesheet(uri)) {            String inlineStyle = _nsh.getInlineStyle(_doc, _context.media);            if (inlineStyle != null) {                reader = new java.io.StringReader(inlineStyle);                Stylesheet sheet = _stylesheetFactory.parse(reader, info);                _stylesheetFactory.putStylesheet(uri, sheet);            }        }        infos.add(info);        //here we should also get user stylesheet from userAgent        long el = System.currentTimeMillis() - st;        XRLog.load("TIME: parse stylesheets  " + el + "ms");        return infos;    }