_styler.setViewportRectangle(_context.getViewport().getBounds());
    public void matchStyles( Document document ) {        try {        if ( _tbStyleMap == null ) {            if ( !_elementStyleAttributesPulled ) {                try {                    NodeList nl = XPathAPI.selectNodeList(document.getDocumentElement(), "//*[@style!='']");                    // HACK: better on first parse and avoid this second sweep (PWW 24-08-04)                    for ( int i=0, len=nl.getLength(); i < len; i++ ) {                        parseElementStyling((Element)nl.item(i));                    }                    _elementStyleAttributesPulled = true;                } catch (Exception ex) {                    System.err.println("Couldn't pull element style attribute.");                    ex.printStackTrace();                }            }                        // we are going to pass a list of pre-sorted XRStyleRules to the mapping routines            // The sort is on origin, specificity, and sequence...in principle, this means            // that rules appearing later in the sort always override rules appearing higher            List sortedXRRules = new ArrayList();            Iterator iter = _stylesheets.iterator();            _tbStyleMap = new net.homelinux.tobe.xhtmlrenderer.matcherImpl.Matcher(document, new StaticHtmlAttributeResolver(), _stylesheets.iterator());            _tbStyleMap.setStylesheetFactory(new StylesheetFactory());                    }        // now we have a match-map, apply against our entire Document....restyleTree() is recursive        Element root = document.getDocumentElement();        _styler = new net.homelinux.tobe.xhtmlrenderer.stylerImpl.Styler();        _styler.setMatcher(_tbStyleMap);        _styler.restyleTree( root );        _styler.setViewportRectangle(_context.getViewport().getBounds());        _matchedSinceLastParse = true;        }        catch(RuntimeException re) {            re.printStackTrace();            throw re;        }        catch(Exception e) {            e.printStackTrace();        }    }