Note that there are some explanatory texts on larger screens.

plurals
  1. PORegarding cssparser
    primarykey
    data
    text
    <p>Friends I am using cssparser for parsing my CSS. My code is like this:</p> <pre><code>public static Map&lt;String, CSSStyleRule&gt; parseCSS1() throws IOException { Map&lt;String, CSSStyleRule&gt; rules = new LinkedHashMap&lt;String, CSSStyleRule&gt;(); InputSource inputSource = new InputSource(new FileReader("C:\\COMPUTERS.css")); CSSStyleSheet styleSheet = new CSSOMParser().parseStyleSheet(inputSource, null, null); CSSRuleList ruleList = styleSheet.getCssRules(); for (int i = 0; i &lt; ruleList.getLength(); i++) { CSSRule rule = ruleList.item(i); if (rule.getType() == CSSRule.STYLE_RULE) { CSSStyleRule styleRule = (CSSStyleRule) rule; rules.put(styleRule.getSelectorText(), styleRule); } } return rules; } </code></pre> <p>Now after parsing when I try to print the value in CSS (<code>rules.getvalues()</code>) it gives this result: </p> <pre><code>BODY { font-family: monospace; color: black; font-size: medium; font-style: normal; font-weight: normal; background-color: rgb(255, 182, 193); background-image: url(images/COMPUTERSbody_computers.gif); border: no } </code></pre> <p>In the last line there is no semicolon after <code>border:no</code> and in the original CSS it is present.</p> <p>So, should I manually add that semicolon or am I making a mistake?</p> <p>Also, in the original CSS: </p> <pre><code>background-color: #FFB6C1 </code></pre> <p>Is replaced by:</p> <pre><code>background-color: rgb(255, 182, 193); </code></pre> <p>in the parsed output. Is there any way to keep the original as it is?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload