- From: CVS User ylafon <cvsmail@w3.org>
- Date: Mon, 06 Jan 2014 06:44:04 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/2002/css-validator/org/w3c/css/css
In directory roscoe:/tmp/cvs-serv22700
Modified Files:
StyleSheetGenerator.java json.properties soap12.properties
ucn.properties xhtml.properties
Added Files:
velocity-tools.xml
Log Message:
escaping now done in templates, error and warning type surfaced in outputs (json and soap12 for now)
--- /sources/public/2002/css-validator/org/w3c/css/css/StyleSheetGenerator.java 2012/10/10 07:45:51 1.35
+++ /sources/public/2002/css-validator/org/w3c/css/css/StyleSheetGenerator.java 2014/01/06 06:44:04 1.36
@@ -5,6 +5,7 @@
import org.apache.velocity.app.Velocity;
import org.apache.velocity.exception.ParseErrorException;
import org.apache.velocity.exception.ResourceNotFoundException;
+import org.apache.velocity.tools.ToolManager;
import org.w3c.css.error.ErrorReportHTML;
import org.w3c.css.parser.CssError;
import org.w3c.css.parser.CssErrorToken;
@@ -39,275 +40,281 @@
*/
public class StyleSheetGenerator extends StyleReport {
- private PrintWriter out;
- private Template template;
- private String template_file;
- private String default_lang = "en";
- private ApplContext ac;
- private StyleSheet style;
- private String title;
- private VelocityContext context;
- private Warnings warnings;
- private Errors errors;
- private static final Utf8Properties availableFormat;
- private static final Utf8Properties availablePropertiesURL;
-
- static {
- availableFormat = new Utf8Properties();
- try {
- java.io.InputStream f;
- f = StyleSheetGenerator.class.getResourceAsStream(
- "format.properties");
- availableFormat.load(f);
- f.close();
- } catch (Exception e) {
- System.err.println("org.w3c.css.css.StyleSheetGeneratorHTML: " +
- "couldn't load format properties ");
- System.err.println(" " + e.toString());
- }
-
- availablePropertiesURL = new Utf8Properties();
- try {
- java.io.InputStream f;
- f = StyleSheetGenerator.class.getResourceAsStream(
- "urls.properties");
- availablePropertiesURL.load(f);
- f.close();
- } catch (Exception e) {
- System.err.println("org.w3c.css.css.StyleSheetGeneratorHTML: " +
- "couldn't load URLs properties ");
- System.err.println(" " + e.toString());
- }
-
- try {
- Velocity.setProperty(Velocity.RESOURCE_LOADER, "file");
- Velocity.addProperty(Velocity.RESOURCE_LOADER, "jar");
- Velocity.setProperty("jar." + Velocity.RESOURCE_LOADER + ".class",
- "org.apache.velocity.runtime.resource.loader.JarResourceLoader");
- URL path = StyleSheetGenerator.class.getResource("/");
- if (path != null) {
- Velocity.addProperty("file." + Velocity.RESOURCE_LOADER +
- ".path", path.getFile());
- Velocity.setProperty("jar." + Velocity.RESOURCE_LOADER + ".path",
- "jar:" + path + "css-validator.jar");
- }
- Velocity.init();
- } catch (Exception e) {
- System.err.println("Failed to initialize Velocity. " +
- "Validator might not work as expected.");
- }
- }
-
- public StyleSheetGenerator(String title, StyleSheet style, String document,
- int warningLevel) {
- this(null, title, style, document, warningLevel);
- }
-
- public StyleSheetGenerator(ApplContext ac, String title, StyleSheet style,
- String document, int warningLevel) {
- ArrayList<CssRuleList> items;
-
- this.ac = ac;
- this.style = style;
- this.title = title;
- this.template_file = availableFormat.getProperty(document);
-
- context = new VelocityContext();
- // add a static ref for templates that needs to do some escaping
- context.put("Messages", Messages.class);
- // adjust the source name if needed
- if (ac.isInputFake()) {
- title = title.substring(title.lastIndexOf('/') + 1);
- }
- context.put("file_title", queryReplace(title));
-
- // W3C_validator_result
- warnings = style.getWarnings();
- errors = style.getErrors();
- items = style.newGetRules();
-
- // Setting all the variables of the velocity context
- ApplContext ac_default = new ApplContext(default_lang);
- String k, v;
- if (ac.getLang() == null || ac.getLang().equals(default_lang)) {
- for (Object s: ac_default.getMsg().properties.keySet()) {
+ private PrintWriter out;
+ private Template template;
+ private String template_file;
+ private String default_lang = "en";
+ private ApplContext ac;
+ private StyleSheet style;
+ private String title;
+ private VelocityContext context;
+ private Warnings warnings;
+ private Errors errors;
+ private static final Utf8Properties availableFormat;
+ private static final Utf8Properties availablePropertiesURL;
+ private static ToolManager velocityToolManager;
+
+ static {
+ availableFormat = new Utf8Properties();
+ try {
+ java.io.InputStream f;
+ f = StyleSheetGenerator.class.getResourceAsStream(
+ "format.properties");
+ availableFormat.load(f);
+ f.close();
+ } catch (Exception e) {
+ System.err.println("org.w3c.css.css.StyleSheetGeneratorHTML: " +
+ "couldn't load format properties ");
+ System.err.println(" " + e.toString());
+ }
+
+ availablePropertiesURL = new Utf8Properties();
+ try {
+ java.io.InputStream f;
+ f = StyleSheetGenerator.class.getResourceAsStream(
+ "urls.properties");
+ availablePropertiesURL.load(f);
+ f.close();
+ } catch (Exception e) {
+ System.err.println("org.w3c.css.css.StyleSheetGeneratorHTML: " +
+ "couldn't load URLs properties ");
+ System.err.println(" " + e.toString());
+ }
+
+ try {
+ Velocity.setProperty(Velocity.RESOURCE_LOADER, "file");
+ Velocity.addProperty(Velocity.RESOURCE_LOADER, "jar");
+ Velocity.setProperty("jar." + Velocity.RESOURCE_LOADER + ".class",
+ "org.apache.velocity.runtime.resource.loader.JarResourceLoader");
+ URL path = StyleSheetGenerator.class.getResource("/");
+ if (path != null) {
+ Velocity.addProperty("file." + Velocity.RESOURCE_LOADER +
+ ".path", path.getFile());
+ Velocity.setProperty("jar." + Velocity.RESOURCE_LOADER + ".path",
+ "jar:" + path + "css-validator.jar");
+ }
+ Velocity.init();
+ velocityToolManager = new ToolManager();
+ velocityToolManager.configure("org/w3c/css/css/velocity-tools.xml");
+ } catch (Exception e) {
+ System.err.println("Failed to initialize Velocity. " +
+ "Validator might not work as expected.");
+ }
+ }
+
+ public StyleSheetGenerator(String title, StyleSheet style, String document,
+ int warningLevel) {
+ this(null, title, style, document, warningLevel);
+ }
+
+ public StyleSheetGenerator(ApplContext ac, String title, StyleSheet style,
+ String document, int warningLevel) {
+ ArrayList<CssRuleList> items;
+
+ this.ac = ac;
+ this.style = style;
+ this.title = title;
+ this.template_file = availableFormat.getProperty(document);
+
+ context = new VelocityContext(velocityToolManager.createContext());
+ // add a static ref for templates that needs to do some escaping
+ context.put("Messages", Messages.class);
+ // adjust the source name if needed
+ if (ac.isInputFake()) {
+ title = title.substring(title.lastIndexOf('/') + 1);
+ }
+ context.put("file_title", queryReplace(title));
+
+ // W3C_validator_result
+ warnings = style.getWarnings();
+ errors = style.getErrors();
+ items = style.newGetRules();
+
+ // Setting all the variables of the velocity context
+ ApplContext ac_default = new ApplContext(default_lang);
+ String k, v;
+ if (ac.getLang() == null || ac.getLang().equals(default_lang)) {
+ for (Object s : ac_default.getMsg().properties.keySet()) {
k = String.valueOf(s);
context.put(k, ac.getMsg().getString(k));
}
- } else {
- for (Object s: ac_default.getMsg().properties.keySet()) {
+ } else {
+ for (Object s : ac_default.getMsg().properties.keySet()) {
k = String.valueOf(s);
v = ac.getMsg().getString(k);
context.put(k, (v == null) ? ac_default.getMsg().getString(k) : v);
}
- }
+ }
- if (ac.getLink() != null) {
- int arraysize = Messages.languages_name.size();
- ArrayList<HashMap<String, String>> languages;
- languages = new ArrayList<HashMap<String, String>>(arraysize);
- String name;
- for (int i = 0; i < arraysize; ++i) {
- name = String.valueOf(Messages.languages_name.get(i));
- HashMap<String, String> l = new HashMap<String, String>();
- l.put("name", name);
- l.put("real", ((Utf8Properties) Messages.languages.get(name)).getProperty("language_name"));
- languages.add(i, l);
- }
- context.put("languages", languages.toArray());
- String link = ac.getLink().replaceAll("&lang=.*&", "&");
- link = link.replaceAll("&lang=.*$", "");
- context.put("link", "?" + link.replaceAll("&", "&"));
- }
-
- // generated values
- SimpleDateFormat formatter;
- formatter = new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ss'Z'");
- formatter.setTimeZone(TimeZone.getTimeZone("UTC"));
- context.put("currentdate", formatter.format(new Date()));
- context.put("lang", ac.getContentLanguage());
- context.put("errors_count", new Integer(errors.getErrorCount()));
- context.put("warnings_count", new Integer(warnings.getWarningCount()));
- context.put("ignored-warnings_count",
- new Integer(warnings.getIgnoredWarningCount()));
- context.put("warning_level", new Integer(warningLevel));
- context.put("rules_count", new Integer(items.size()));
- context.put("no_errors_report", Boolean.FALSE);
- context.put("charset", ac.getContentEncoding());
- context.put("cssversion", ac.getCssVersionString());
- context.put("css_profile", ac.getProfileString());
- context.put("css", ac.getMsg().getString(ac.getCssVersionString()));
- context.put("css_link", getURLProperty("@url-base_" + ac.getCssVersionString()));
- context.put("is_valid", (errors.getErrorCount() == 0) ? "true" : "false");
- context.put("fake_input", Boolean.valueOf(ac.isInputFake()));
- context.put("author", "www-validator-css");
- context.put("author-email", "Email.html");
- if (style.charset != null)
- context.put("style_charset", style.charset);
-
- produceError();
- produceWarning();
- produceStyleSheet();
-
- try {
- template = Velocity.getTemplate("org/w3c/css/css/" + template_file);
- template.setEncoding("utf-8");
- } catch (ResourceNotFoundException rnfe) {
- System.err.println(rnfe.getMessage());
- rnfe.printStackTrace();
- } catch (ParseErrorException pee) {
- System.err.println(pee.getMessage());
- pee.printStackTrace();
- } catch (Exception e) {
- System.err.println(e.getMessage());
- e.printStackTrace();
- }
- }
-
- private final static String getURLProperty(String name) {
- return availablePropertiesURL.getProperty(name);
- }
-
- public final static void printAvailableFormat(PrintWriter out) {
- Enumeration e = availableFormat.propertyNames();
- out.println(" -- listing available output format --");
- while (e.hasMoreElements()) {
- String key = ((String) e.nextElement()).toLowerCase();
- out.println("Format : " + key);
- out.println(" File : " + getDocumentName(key));
- }
- out.flush();
- }
-
-
- /**
- * Test if <tt>document</tt> is an available output
- *
- * @param document, the desired output
- * @return <tt>true</tt> if the desired output is available
- */
- public static boolean isAvailableFormat(String document) {
- return availableFormat.containsKey(document);
- }
-
-
- private final static String getDocumentName(String documentName) {
- String document = availableFormat.getProperty(documentName
- .toLowerCase());
- if (document == null) {
- System.err.println("Unable to find " + documentName.toLowerCase()
- + " output format");
- return documentName;
- } else {
- return document;
- }
- }
-
- /**
- * Add the style information to the context
- */
- private void produceStyleSheet() {
- context.put("at_rules_list", style.newGetRules());
- }
-
- /**
- * Add the errors information to the context
- * For each error,
- * <ul>
- * <li> the error type and message, and
- * <li> the context type and value
- * </ul>
- * are set.
- */
- private void produceError() {
- Hashtable[] errors_content = new Hashtable[errors.getErrorCount()];
-
- try {
- if (errors.getErrorCount() != 0) {
- CssError[] error = errors.getErrors();
- int nbError = error.length;
- for (int i = 0; i < nbError; i++) {
- CssError csserror = error[i];
- Throwable ex = csserror.getException();
- Hashtable<String, Object> h = new Hashtable<String, Object>();
- errors_content[i] = h;
- h.put("Error", csserror);
- h.put("CtxName", "nocontext");
- h.put("CtxMsg", "");
- h.put("ErrorMsg", ((ex.getMessage() == null) ? "" :
- ex.getMessage()));
- h.put("ClassName", "unkownerror");
- if (ex instanceof FileNotFoundException) {
- h.put("ClassName", "notfound");
- h.put("ErrorMsg",
- ac.getMsg().getGeneratorString("not-found") +
- ": " + ex.getMessage());
- } else if (ex instanceof CssParseException) {
- produceParseException((CssParseException) ex, h);
- } else if (ex instanceof InvalidParamException) {
+ if (ac.getLink() != null) {
+ int arraysize = Messages.languages_name.size();
+ ArrayList<HashMap<String, String>> languages;
+ languages = new ArrayList<HashMap<String, String>>(arraysize);
+ String name;
+ for (int i = 0; i < arraysize; ++i) {
+ name = String.valueOf(Messages.languages_name.get(i));
+ HashMap<String, String> l = new HashMap<String, String>();
+ l.put("name", name);
+ l.put("real", ((Utf8Properties) Messages.languages.get(name)).getProperty("language_name"));
+ languages.add(i, l);
+ }
+ context.put("languages", languages.toArray());
+ String link = ac.getLink().replaceAll("&lang=.*&", "&");
+ link = link.replaceAll("&lang=.*$", "");
+ context.put("link", "?" + link.replaceAll("&", "&"));
+ }
+
+ // generated values
+ SimpleDateFormat formatter;
+ formatter = new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ss'Z'");
+ formatter.setTimeZone(TimeZone.getTimeZone("UTC"));
+ Date now = new Date();
+ context.put("currentdate", formatter.format(now));
+ context.put("currentdatelong", now.getTime());
+ context.put("lang", ac.getContentLanguage());
+ context.put("errors_count", new Integer(errors.getErrorCount()));
+ context.put("warnings_count", new Integer(warnings.getWarningCount()));
+ context.put("ignored-warnings_count",
+ new Integer(warnings.getIgnoredWarningCount()));
+ context.put("warning_level", new Integer(warningLevel));
+ context.put("rules_count", new Integer(items.size()));
+ context.put("no_errors_report", Boolean.FALSE);
+ context.put("charset", ac.getContentEncoding());
+ context.put("cssversion", ac.getCssVersionString());
+ context.put("css_profile", ac.getProfileString());
+ context.put("css", ac.getMsg().getString(ac.getCssVersionString()));
+ context.put("css_link", getURLProperty("@url-base_" + ac.getCssVersionString()));
+ context.put("is_valid", (errors.getErrorCount() == 0) ? "true" : "false");
+ context.put("fake_input", Boolean.valueOf(ac.isInputFake()));
+ context.put("author", "www-validator-css");
+ context.put("author-email", "Email.html");
[489 lines skipped]
--- /sources/public/2002/css-validator/org/w3c/css/css/json.properties 2009/02/27 22:10:15 1.2
+++ /sources/public/2002/css-validator/org/w3c/css/css/json.properties 2014/01/06 06:44:04 1.3
@@ -1,13 +1,67 @@
{
"cssvalidation" : {
- "uri" : "$file_title",
+ "uri" : "$esc.java($file_title)",
"checkedby" : "http://www.w3.org/2005/07/css-validator",
"csslevel" : "$cssversion",
"date" : "$currentdate",
+ "timestamp" : "$currentdatelong",
"validity" : $is_valid,
"result" : {
"errorcount" : $errors_count,
"warningcount" : $warnings_count
}
+#if ($errors_count > 0)
+ #set ($isfirst = true) ,
+ "errors" : [
+ #foreach ($error_content in $errors_content)
+ #if ( $isfirst )
+ #set ($isfirst = false)
+ #else
+ ,
+ #end
+#set ($err = $error_content.get("Error"))
+#if ($error_content.get("link_value_parse_error"))
+#set ($link_value = $error_content.get("link_value_parse_error"))
+#else #set ($link_value = false ) #end
+#if ($error_content.get("span_value_parse_error"))
+#set ($span_value = $error_content.get("span_value_parse_error"))
+#else #set ($span_value = false) #end
+
+#set ( $errSource = $esc.java($err.SourceFile) )
+ {
+ "source" : "$errSource",
+#if ($err.Line && $err.line > 0)
+ "line" : $err.Line,
+#end
+ "context" : "$esc.java($!error_content.get("CtxMsg"))",
+ "type" : "$esc.java($error_content.get("Type"))",
+ "message" : "$esc.java($error_content.get("ErrorMsg"))"
+ }
+ #end
+ ]
+#end
+#if ($warnings_count > 0)
+ #set ($isfirst = true) ,
+ "warnings" : [
+ #foreach ($warning in $warnings_list)
+ #if ( $isfirst )
+ #set ($isfirst = false)
+ #else
+ ,
+ #end
+ #if ( $warning.Level <= $warning_level )
+ {
+ "source" : "$esc.java($warning.SourceFile)",
+ "line" : $warning.Line,
+#if ( $warning.Context ) "context" : "$esc.java($warning.Context)",
+#end
+ "message" : "$esc.java($!warning.WarningMessage)",
+ "type" : "$esc.java($warning.Type)",
+ "level" : $warning.Level
+ }
+ #end
+ #end
+ ]
+#end
}
}
--- /sources/public/2002/css-validator/org/w3c/css/css/soap12.properties 2009/02/25 20:40:24 1.7
+++ /sources/public/2002/css-validator/org/w3c/css/css/soap12.properties 2014/01/06 06:44:04 1.8
@@ -4,7 +4,7 @@
<m:cssvalidationresponse
env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"
xmlns:m="http://www.w3.org/2005/07/css-validator">
- <m:uri>$file_title</m:uri>
+ <m:uri>$esc.xml($file_title)</m:uri>
<m:checkedby>http://jigsaw.w3.org/css-validator/</m:checkedby>
<m:csslevel>$cssversion</m:csslevel>
<m:date>$currentdate</m:date>
@@ -35,36 +35,38 @@
</m:errorlist>
#end
- #set ( $sf = $err.SourceFileEscaped )
+ #set ( $sf = $err.SourceFile )
+ #set ( $sfe = $esc.xml($err.SourceFile) )
<m:errorlist>
- <m:uri>$sf</m:uri>
+ <m:uri>$sfe</m:uri>
#set ( $open = true )
#end
<m:error>
<m:line>$err.Line</m:line>
<m:errortype>$class_name</m:errortype>
- #if ( $context_msg )<m:context> $context_msg </m:context>#end
+ #if ( $context_msg )<m:context>$esc.xml($context_msg)</m:context>#end
#if ( $span_value )
#set ( $span_class = $error_content.get("span_class_parse_error") )
<m:errorsubtype>
- $span_class
+ $esc.xml($span_class)
</m:errorsubtype>
<m:skippedstring>
- $span_value
+ $esc.xml($span_value)
</m:skippedstring>
+ <m:type>$esc.xml($error_content.get("Type"))</m:type>
#end
<m:message>
#if ( $link_value )
#set ( $link_name = $error_content.get("link_name_parse_error") )
- $before_link : $link_name ($link_value)
+ $before_link : $esc.xml($link_name) ($esc.xml($link_value))
#end
- $error_msg
+ $esc.xml($error_msg)
</m:message>
</m:error>
#end
@@ -86,10 +88,11 @@
</m:warninglist>
#end
- #set ( $sf = $warning.SourceFileEscaped )
+ #set ( $sf = $warning.SourceFile )
+ #set ( $sfe = $esc.xml($warning.SourceFile) )
<m:warninglist>
- <m:uri>$sf</m:uri>
+ <m:uri>$sfe</m:uri>
#set ( $open = true )
#end
#if ( $warning.Level <= $warning_level )
@@ -97,10 +100,11 @@
<m:warning>
<m:line>$warning.Line</m:line>
<m:level>$warning.Level</m:level>
- <m:message>$warning.WarningMessageEscaped</m:message>
+ <m:message>$esc.xml($warning.WarningMessage)</m:message>
#if ( $warning.Context )
- <m:context>$warning.Context.Escaped</m:context>
+ <m:context>$esc.xml($warning.Context)</m:context>
#end
+ <m:type>$esc.xml($warning.Type)</m:type>
</m:warning>
#end
#end
--- /sources/public/2002/css-validator/org/w3c/css/css/ucn.properties 2012/09/13 12:56:50 1.42
+++ /sources/public/2002/css-validator/org/w3c/css/css/ucn.properties 2014/01/06 06:44:04 1.43
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding="$charset"?>
-<observationresponse xmlns="http://www.w3.org/2009/10/unicorn/observationresponse" ref="$file_title" date="$currentdate" xml:lang="$lang">
+<observationresponse xmlns="http://www.w3.org/2009/10/unicorn/observationresponse" ref="$esc.xml($file_title)" date="$currentdate" xml:lang="$lang">
#if ($is_valid == "true")
<status value="passed"/>
@@ -41,13 +41,15 @@
#set ($span_value = $error_content.get("span_value_parse_error"))
#else #set ($span_value = false) #end
-<message type="error" #if ($err.SourceFileEscaped != $file_title)ref="$err.SourceFileEscaped"#end>
- <context #if ($err.Line && $err.line > 0)line="$err.Line"#end>$!error_content.get("CtxMsg")</context>
+#set ($errSource = $esc.xml($err.SourceFile))
+
+<message type="error" #if ($errSource != $file_title)ref="$errSource"#end>
+ <context #if ($err.Line && $err.line > 0)line="$err.Line"#end>$esc.xml($!error_content.get("CtxMsg"))</context>
<title>
#if ( $link_value )
$error_content.get("link_before_parse_error") : $error_content.get("link_name_parse_error") ($link_value)
#end
- $Messages.escapeString($error_content.get("ErrorMsg"))
+ $esc.xml($error_content.get("ErrorMsg"))
#if ( $span_value )
$span_value
#end
@@ -57,9 +59,10 @@
#foreach ($warning in $warnings_list)
#if ($warning.Level <= $warning_level)
-<message type="warning" level="$warning.Level" #if ($warning.SourceFileEscaped != $file_title)ref="$warning.SourceFileEscaped"#end>
- <context line="$!warning.Line" >$!warning.Context.Escaped</context>
- <title>$warning.WarningMessageEscaped</title>
+#set ($warningSource = $esc.xml($warning.SourceFile))
+<message type="warning" level="$warning.Level" #if ($warningSource != $file_title)ref="$esc.xml($warningSource)"#end>
+ <context line="$!warning.Line" >#if ( $warning.Context ) $esc.xml($!warning.Context) #end</context>
+ <title>$esc.xml($warning.WarningMessage)</title>
</message>
#end
#end
--- /sources/public/2002/css-validator/org/w3c/css/css/xhtml.properties 2013/10/14 14:19:25 1.39
+++ /sources/public/2002/css-validator/org/w3c/css/css/xhtml.properties 2014/01/06 06:44:04 1.40
@@ -1,16 +1,16 @@
-<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html lang='$content-language' xml:lang='$content-language' xmlns='http://www.w3.org/1999/xhtml' dir="$direction">
+<html lang="$content-language" xml:lang="$content-language" xmlns="http://www.w3.org/1999/xhtml" dir="$direction">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta name="ROBOTS" content="NOINDEX, NOFOLLOW" />
#if ( !$css ) #set ( $css = $cssversion ) #end
- <title>$W3C_validator_results $file_title ($css)</title>
+ <title>$W3C_validator_results $esc.html($file_title) ($css)</title>
<link href="http://jigsaw.w3.org/css-validator/" rel="validator" />
- <link type="text/css" rel='stylesheet' href='style/base.css' />
- <link type="text/css" rel='stylesheet' href='style/results.css' />
+ <link type="text/css" rel="stylesheet" href="style/base.css" />
+ <link type="text/css" rel="stylesheet" href="style/results.css" />
</head>
<body>
<div id="banner">
@@ -19,7 +19,7 @@
<a href="./"><span>$W3C_CSS_validation_service</span></a></h1>
<p id="tagline">
- $W3C_validator_results $file_title ($css)
+ $W3C_validator_results $esc.html($file_title) ($css)
</p>
</div>
@@ -43,14 +43,14 @@
#end
<div id="results_container">
#if ($file_title.trim().startsWith("http://"))
- <h2>$W3C_validator_results <a href="$file_title">$file_title</a> ($css)</h2>
+ <h2>$W3C_validator_results <a href="$esc.html($file_title)">$esc.html($file_title)</a> ($css)</h2>
#else
- <h2>$W3C_validator_results $file_title ($css)</h2>
+ <h2>$W3C_validator_results $esc.html($file_title) ($css)</h2>
#end
#if ( !$no_errors_report )
#if ($errors_count == 0)
<!-- NO ERRORS -->
- <div id='congrats'>
+ <div id="congrats">
<h3>$congrats</h3>
<p>
$doc_validates_before_link <a href="$css_link">$css</a> $doc_validates_after_link
@@ -59,7 +59,7 @@
$no_errors_interoperable_msg
</p>
<img class="inline-badge" style="border:0;width:88px;height:31px" src="http://jigsaw.w3.org/css-validator/images/vcss" alt="$valid_CSS" />
- <pre class='example badgeSnippet'>
+ <pre class="example badgeSnippet">
<p>
<a href="http://jigsaw.w3.org/css-validator/check/referer">
<img style="border:0;width:88px;height:31px"
@@ -69,7 +69,7 @@
</p>
</pre>
<img class="inline-badge" style="border:0;width:88px;height:31px" src="http://jigsaw.w3.org/css-validator/images/vcss-blue" alt="$valid_CSS" />
- <pre class='example badgeSnippet'>
+ <pre class="example badgeSnippet">
<p>
<a href="http://jigsaw.w3.org/css-validator/check/referer">
<img style="border:0;width:88px;height:31px"
@@ -114,7 +114,7 @@
<h4>$request</h4>
#end
- <div class='error-section-all'>
+ <div class="error-section-all">
#foreach ( $error_content in $errors_content )
#set ( $err = $error_content.get("Error") )
#set ( $error_msg = $error_content.get("ErrorMsg") )
@@ -139,9 +139,9 @@
<!--end of individual error section-->
</div>
#end
- #set ( $sf = $err.SourceFileEscaped )
+ #set ( $sf = $esc.html($err.SourceFile) )
- <div class='error-section'>
+ <div class="error-section">
#if ( $fake_input )
<h4>URI : $file_title</h4>
#else
@@ -151,22 +151,22 @@
#set ( $open = true )
#end
- <tr class='error'>
- <td class='linenumber' title='Line $err.Line'>$err.Line</td>
- <td class='$context_name'>#if ( $context_msg ) $context_msg #end</td>
- <td class='$class_name'>
+ <tr class="error">
+ <td class="linenumber" title="Line $err.Line">$err.Line</td>
+ <td class="$context_name">#if ( $context_msg ) $esc.html($context_msg) #end</td>
+ <td class="$class_name">
#if ( $link_value )
#set ( $link_name = $error_content.get("link_name_parse_error") )
- $before_link : <a href="$link_value">$link_name</a>
+ $before_link : <a href="$esc.html($link_value)">$esc.html($link_name)</a>
#end
- $error_msg
+ $esc.html($error_msg)
#if ( $span_value )
#set ( $span_class = $error_content.get("span_class_parse_error") )
<span class="$span_class">
- $span_value
+ $esc.html($span_value)
</span>
#end
@@ -192,7 +192,7 @@
<!-- DEALING WITH WARNINGS -->
<div id="warnings">
<h3>$warnings ($warnings_count)</h3>
- <div class='warning-section-all'>
+ <div class="warning-section-all">
#set ( $sf = "" )
#set ( $open = false )
#foreach ( $warning in $warnings_list )
@@ -203,9 +203,9 @@
<!--end of individual warning section-->
</div>
#end
- #set ( $sf = $warning.SourceFileEscaped )
+ #set ( $sf = $esc.html($warning.SourceFile) )
- <div class='warning-section'>
+ <div class="warning-section">
#if ( $fake_input )
<h4>URI : $file_title</h4>
#else
@@ -216,10 +216,10 @@
#end
#if ( $warning.Level <= $warning_level )
- <tr class='warning'>
- <td class='linenumber' title='Line $warning.Line'>$warning.Line</td>
- <td class='codeContext'>#if ( $warning.Context ) $warning.Context.Escaped #end</td>
- <td class='level$warning.Level' title='warning level $warning.Level'>$warning.WarningMessageEscaped</td>
+ <tr class="warning">
+ <td class="linenumber" title="Line $warning.Line">$warning.Line</td>
+ <td class="codeContext">#if ( $warning.Context ) $esc.html($warning.Context) #end</td>
+ <td class="level$warning.Level" title="warning level $warning.Level">$esc.html($warning.WarningMessage)</td>
</tr>
#end
#end
@@ -237,21 +237,21 @@
#if ( $rules_count > 0 )
<div id="css">
<h3>$valid_CSS_info</h3>
- <div class='vAtRule'>
+ <div class="vAtRule">
#if ($style_charset)
- <div class='vCharset'>@charset "$style_charset";</div>
+ <div class="vCharset">@charset "$style_charset";</div>
#end
#foreach ( $rules in $at_rules_list )
#if ( $rules.AtRule != "" )
#if ( $rules.Empty )
- <div class='vEmptyAtRule'>$rules.AtRuleEscaped
+ <div class="vEmptyAtRule">$esc.html($rules.AtRule)
#else
- <div class='atRule'>
- <span class='atSelector'>
- $rules.AtRuleEscaped
+ <div class="atRule">
+ <span class="atSelector">
+ $esc.html($rules.AtRule)
</span>
{
#end
@@ -260,19 +260,19 @@
<div>
#foreach ( $rule in $rules.StyleRules )
- <div class='selector'>
+ <div class="selector">
#if ( $rule.Selectors )
- <span class='selectorValue'>
- $rule.SelectorsEscaped
+ <span class="selectorValue">
+ $esc.html($rule.Selectors)
</span>
{
#end
- <div class='RuleList'>
+ <div class="RuleList">
#foreach ( $property in $rule.Properties )
- <div class='Rule'>
- <span class='Property'>$property.PropertyNameEscaped</span> :
- <span class='PropertyValue'>$property.Escaped</span>#if ( $property.Important ) !important #end;
+ <div class="Rule">
+ <span class="Property">$esc.html($property.PropertyName)</span> :
+ <span class="PropertyValue">$esc.html($property)</span>#if ( $property.Important ) !important #end;
</div>
#end
@@ -341,11 +341,12 @@
</p>
<p class="copyright">
<a rel="Copyright" href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a>
- © 1994-2009
+ © 1994-2013
<a href="http://www.w3.org/"><acronym title="World Wide Web Consortium">W3C</acronym></a>®
(<a href="http://www.csail.mit.edu/"><acronym title="Massachusetts Institute of Technology">MIT</acronym></a>,
<a href="http://www.ercim.eu/"><acronym title="European Research Consortium for Informatics and Mathematics">ERCIM</acronym></a>,
- <a href="http://www.keio.ac.jp/">Keio</a>),
+ <a href="http://www.keio.ac.jp/">Keio</a>,
+ <a href="http://ev.buaa.edu.cn/">Beihang</a>),
All Rights Reserved.
W3C <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
<a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a>,
--- /sources/public/2002/css-validator/org/w3c/css/css/velocity-tools.xml 2014/01/06 06:44:04 NONE
+++ /sources/public/2002/css-validator/org/w3c/css/css/velocity-tools.xml 2014/01/06 06:44:04 1.1
<tools>
<data type="number" key="TOOLS_VERSION" value="2.0"/>
<data type="boolean" key="GENERIC_TOOLS_AVAILABLE" value="true"/>
<toolbox scope="application">
<tool class="org.apache.velocity.tools.generic.AlternatorTool"/>
<tool class="org.apache.velocity.tools.generic.DisplayTool"/>
<tool class="org.apache.velocity.tools.generic.MathTool"/>
<tool class="org.apache.velocity.tools.generic.NumberTool"/>
<tool class="org.apache.velocity.tools.generic.ComparisonDateTool"/>
<tool class="org.apache.velocity.tools.generic.ClassTool"/>
<tool class="org.apache.velocity.tools.generic.ConversionTool"/>
<tool class="org.apache.velocity.tools.generic.EscapeTool"/>
<tool class="org.apache.velocity.tools.generic.FieldTool"/>
<tool class="org.apache.velocity.tools.generic.ListTool"/>
<tool class="org.apache.velocity.tools.generic.ResourceTool"/>
<tool class="org.apache.velocity.tools.generic.SortTool"/>
</toolbox>
<toolbox scope="request">
<tool class="org.apache.velocity.tools.generic.LoopTool"/>
<tool class="org.apache.velocity.tools.generic.ContextTool"/>
<tool class="org.apache.velocity.tools.generic.LinkTool"/>
<tool class="org.apache.velocity.tools.generic.RenderTool"/>
</toolbox>
</tools>
Received on Monday, 6 January 2014 06:44:06 UTC