* Parses a set of rules from its CSS text.
*/
public static void parseRules(CSSOMStyleSheet ss, String rules)
throws DOMException {
try {
Parser parser = ss.getParser();
parser.setSelectorFactory(AbstractCSSRule.SELECTOR_FACTORY);
parser.setConditionFactory(AbstractCSSRule.CONDITION_FACTORY);
parser.setDocumentHandler(new CSSDocumentHandler(ss, true));
parser.parseStyleSheet(new InputSource(new StringReader(rules)));
} catch (DOMException e) {
throw e;
} catch (Exception e) {
throw CSSDOMExceptionFactory.createDOMException
(DOMException.SYNTAX_ERR,