Search in sources :

Example 1 with CSSOMParser

use of com.steadystate.css.parser.CSSOMParser in project tdi-studio-se by Talend.

the class CSSParserUtils method parserCSSSelectors.

public static CSSRuleList parserCSSSelectors(Reader read, String url) {
    CSSOMParser cssparser = new CSSOMParser();
    CSSStyleSheet css = null;
    try {
        if (read == null)
            //$NON-NLS-1$
            css = cssparser.parseStyleSheet(new InputSource("file:" + url), null, null);
        else
            css = cssparser.parseStyleSheet(new InputSource(read), null, null);
    } catch (IOException e) {
        ExceptionHandler.process(e);
        return null;
    }
    return css.getCssRules();
}
Also used : InputSource(org.w3c.css.sac.InputSource) CSSOMParser(com.steadystate.css.parser.CSSOMParser) CSSStyleSheet(org.w3c.dom.css.CSSStyleSheet) IOException(java.io.IOException)

Aggregations

CSSOMParser (com.steadystate.css.parser.CSSOMParser)1 IOException (java.io.IOException)1 InputSource (org.w3c.css.sac.InputSource)1 CSSStyleSheet (org.w3c.dom.css.CSSStyleSheet)1