}
}
protected void handleRule(Document document, String selectorText, Map<String,String> styles) throws NodeSelectorException {
DOMNodeSelector selector = new DOMNodeSelector(document);
Set<Node> matches = selector.querySelectorAll(selectorText);
for(Node matchedNode : matches) {
if(matchedNode instanceof Element) {
Element element = (Element)matchedNode;
for (Map.Entry<String,String> rule : styles.entrySet()) {
element.setAttribute(rule.getKey(), rule.getValue());