Since CSS is a formal language, in all likelihood Java parsers for this type of task already exist. I would Google for them and then use them, rather than try to re-invent that which has already been...