This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 890 - Error always on line 0
Summary: Error always on line 0
Status: RESOLVED FIXED
Alias: None
Product: CSSValidator
Classification: Unclassified
Component: Other (show other bugs)
Version: CSS Validator
Hardware: All All
: P1 critical
Target Milestone: ---
Assignee: Yves Lafon
QA Contact: qa-dev tracking
URL:
Whiteboard:
Keywords:
: 209 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-09-26 21:32 UTC by Uzi Landsmann
Modified: 2006-03-05 12:50 UTC (History)
1 user (show)

See Also:


Attachments

Description Uzi Landsmann 2004-09-26 21:32:30 UTC
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);
		}
	}
}
Comment 1 Olivier Thereaux 2004-10-06 01:34:46 UTC
*** Bug 209 has been marked as a duplicate of this bug. ***
Comment 2 Olivier Thereaux 2004-10-06 01:35:54 UTC
Marking bugs to be fixed in priority