This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
When I run my program using the css editor on the following css file: .test { background-color_: AliceBlue; } I get the following output: > java CssTest exception: org.w3c.css.parser.CssParseException: Property background-color_ doesn't exist line: 0 ...when it should be line 2. The program is as follows: import java.net.MalformedURLException; import java.net.URL; import org.w3c.css.css.StyleSheet; import org.w3c.css.css.StyleSheetOrigin; import org.w3c.css.css.StyleSheetParser; import org.w3c.css.parser.CssError; import org.w3c.css.util.ApplContext; import org.w3c.css.util.Warning; public class CssTest { public static void main(String[] args) { ApplContext ac = new ApplContext("en"); String fileName = "C:\\Dev\\css-validator\\test.css"; URL url = null; try { url = new URL("file", "/", fileName); } catch(MalformedURLException murle) { murle.printStackTrace(); } String title = "title"; String kind = "stylesheet"; String media = null; StyleSheetParser parser = new StyleSheetParser(); parser.parseURL(ac, url, title, kind, media, StyleSheetOrigin.AUTHOR); StyleSheet style = parser.getStyleSheet(); CssError[] errors = style.getErrors().getErrors(); Warning[] warnings = style.getWarnings().getWarnings(); for (int i = 0; i < errors.length; i++) { CssError cssError = errors[i]; System.err.println("error: " + cssError); } } }
*** Bug 209 has been marked as a duplicate of this bug. ***
Marking bugs to be fixed in priority