Re: Is java / sac /flute a dead product.

* Randy Paries wrote:
>Subject: Is java / sac /flute a dead product.

I think it would be fair to say that, yes. There is a little bit of
interest at least in SAC every now and then, but not much more as far
as I can tell. flute in particular is probably obsoleted by the other
parsers listed, or not, on the SAC homepage.

>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.

(They are called properties in most cases).

>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..........

That depends on what you want to do exactly. As I recall, the parts of
the selector are stored as binary tree, e.g., if you have a selector
like "A B C" you get a structure like

                                        ElementSelector
                                       /
                     DescendantSelector
                    /                  \
  DescendantSelector                    ElementSelector
                    \
                     ElementSelector

or something along these lines. Your "#container" is the same as the
selector "*#container" so it would be stored as ConditionalSelector
where the universal selector is the SimpleSelector and the Condition
is of type SAC_ID_CONDITION; you can then cast the Condition into a
AttributeCondition and use the .getValue() method to get the ID from
the selector.
-- 
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/ 

Received on Thursday, 24 April 2008 18:54:53 UTC