[ajax-user] CSS Parser and docs?
Brought to you by:
vamp201
From: Monte H. <mon...@gm...> - 2006-04-13 20:44:35
|
Does anyone know of a decent open-source utility for parsing CSS? I want to be able to parse a style sheet and extract attribute values by attribute name. Something like this: CSSstylesheet css =3D new CSSstylesheet("all.css"); Rule rules[] =3D css.getRules(); for(int i=3D0;i<rules.length();i++){ currRule =3D rules[i]; System.out.println(currRule.getSelector() + "\n" + currRule.getAttributeValue("margin-left")); } I tried Cypress, but found that there were about 20 classes with no substantive javadocs or usage examples. The other CSS parser I found was distributed as a Windows DLL, which is incompatible with the usage environment. Thanks. -- Monte Hayward http://www.rootlet.blogspot.com |