- From: Randy Paries <rtparies@gmail.com>
- Date: Thu, 24 Apr 2008 13:07:45 -0500
- To: www-style@w3.org
I am trying to implement a very simple application that parses an external css and places the values into a DB Found the article http://lists.w3.org/Archives/Public/www-style/2002Nov/0006.html that showed an example or how to use sac and flute. I got that working, but for the life of me cannot figure out how to get the names of the selectors The reason I ask if this list is dead is someone asked this question in like 2003 and never posted an answer. I can print out all the properties with their names and values fine. For example , I can figure out how to get all the attributes (not sure if that is the correct term) like width and margin with their values. I can 't figure how to get the name container, unless it is a Selector of type ElementSelector #container{ width: 100%; margin: 5px auto; background-color: #fff; color: #333; border: 1px solid gray; } This is how I am trying to do it public void startSelector(SelectorList patterns) throws CSSException { if (!inMedia) { for (int x=0 ; x < patterns.getLength(); x++ ){ Selector selector = patterns.item(x); if (selector instanceof ElementSelector ){ System.out.println( "name-->" + ((ElementSelector)selector).getLocalName() ); }else if (selector instanceof ConditionalSelector ){ //not sure what to do here.......... } int c=0; } inStyleRule = true; propertyCounter = 0; } } Thanks for any help at all Randy
Received on Thursday, 24 April 2008 18:23:38 UTC