From: Martin F. <fox...@gm...> - 2011-09-29 15:16:30
|
Hi Alan, Thanks for your response, I'm using the 0.9.5 version, as in http://sourceforge.net/projects/cssparser/files/cssparser/ that one is the latest released version. Here is an example code: package pruebitas; import org.w3c.dom.css.CSSStyleDeclaration; import com.steadystate.css.dom.CSSRuleListImpl; import com.steadystate.css.dom.CSSStyleDeclarationImpl; import com.steadystate.css.dom.CSSStyleRuleImpl; import com.steadystate.css.dom.CSSStyleSheetImpl; public class MyParser { public static void main(String[] args){ CSSStyleSheetImpl _styleSheet = null; _styleSheet = new CSSStyleSheetImpl(); _styleSheet.setCssRules(new CSSRuleListImpl()); // Create a new rule CSSStyleRuleImpl foundRule = new CSSStyleRuleImpl(); foundRule.setParentStyleSheet(_styleSheet); foundRule.setSelectorText("#an-id-for-this"); ((CSSRuleListImpl)_styleSheet.getCssRules()).add(foundRule); // set the rule's attribute value CSSStyleDeclaration declaration = foundRule.getStyle(); // If declaration is null, add a new declaration to the above rule. if (declaration == null) { // Create a new Declaration declaration = new CSSStyleDeclarationImpl(foundRule); // Add the declaration to the rule ((CSSStyleRuleImpl)foundRule).setStyle((CSSStyleDeclarationImpl)declaration); } declaration.setProperty("font-family", "arial, verdana, sans-serif", null); System.out.println("<<<<<<<<START>>>>>>>>"); System.out.println(_styleSheet.toString()); System.out.println("<<<<<<<<END>>>>>>>>"); } } On Thu, Sep 29, 2011 at 11:22 AM, Alan Krueger <al...@tr...> wrote: > On 9/22/2011 12:33 PM, Martin Fox wrote: > > I just changed the version to the latest one, and when I run > the getCssText() of a style sheet, the *font-family* value is coming > without the comas that separate the different families in a same rule. > > That was not happening in the previous version :( > > Do you know how can I fix it? > I replaced the version because the last one was giving me error when I > parse an @import(), but now I'm having this issue. > > Could you attach some sample code—maybe even a JUnit test—that > demonstrates the problem? > > Specifically which version are you seeing this on? We're in the middle of > wrapping up 0.9.6 and I'm unsure if you're using one of the snapshot builds > of that, or if you meant that you moved up to 0.9.5 from something else. > > You might want to try one of the snapshots of 0.9.6, as there were a number > of bugfixes applied to that. > > Thanks, > Alan Krueger > > > > ------------------------------------------------------------------------------ > All the data continuously generated in your IT infrastructure contains a > definitive record of customers, application performance, security > threats, fraudulent activity and more. Splunk takes this data and makes > sense of it. Business sense. IT sense. Common sense. > http://p.sf.net/sfu/splunk-d2dcopy1 > _______________________________________________ > cssparser-developers mailing list > css...@li... > https://lists.sourceforge.net/lists/listinfo/cssparser-developers > > |