有没有可以在本地运行的开源CSS验证器? [英] Is there an open source CSS validator that can be run locally?

查看:167
本文介绍了有没有可以在本地运行的开源CSS验证器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想检查内部网页,因此我无法使用 W3C验证服务直。我设法在本地运行XHTML验证程序,但是,我有一些问题的CSS验证程序。我真的不想设置 Tomcat 拼图,以便能够运行Java servlet,并且命令行选项给我一个错误消息

I want to check internal web pages, so I cannot use the W3C validation service directly. I managed to run the XHTML validator locally, however, I have some problems with the css-validator. I do not really want to setup Tomcat or Jigsaw in order to be able to run Java servlet, and the commandline option gives me an error message

线程main中的异常java.lang.NoClassDefFoundError:org.w3c.css.css.CssValidator.main(CssValidator.java:164)中的org.w3c.tools.resources.ProtocolException

有没有人知道我可以在Linux平台上本地运行的替代方法?

Does anybody know of an alternative that I can run locally on a Linux box?

推荐答案

您可以调用 W3C验证工具命令行:


命令行使用

Command-Line use

任何安装了Java的计算机都可以
作为命令行
工具从
终端/控制台运行验证器。下载css-validator.jar
jar文件(或使用ant jar构建它)
并运行它:

Any computer with Java installed can also run the validator from the terminal/console as a commandline tool. Download the css-validator.jar jar archive (or build it with ant jar) and run it as :

java -jar css-validator.jar http://www.w3.org/

注意: css-validator.jar 文件必须
位于与
完全相同的级别,lib /文件夹才能正常工作。

Note : the css-validator.jar file must be located at the exact same level as the lib/ folder to work properly.

更新:为了让它工作,我检出了从CVS的完整分布,并运行 ant 使用包含的 build.xml 。它下载了除 servlet.jar 之外的所有依赖项。为了解决这个问题,我下载了 Tomcat 6 的二进制发行版并解压缩。然后,我编辑 build.xml css-validator 以反映 servlet的位置.lib

Update: To get it to work, I checked out the full distribution from CVS and ran ant using the included build.xml. It downloaded all dependencies except for servlet.jar. To deal with that, I downloaded the binary distribution of Tomcat 6 and extracted it. Then, I edited the build.xml for css-validator to reflect the location of servlet.lib:

<property name="servlet.lib" 
 value="E:/Downloads/apache-tomcat-6.0.20/lib/servlet-api.jar"/>

然后再次运行 ant 。这会在CVS中检出的目录的顶层生成 css-validator.jar 文件,其中包含 lib 子目录包含取决于其他 jar 。然后,我能够成功运行验证器:

Then ran ant again. This produced the css-validator.jar file in the top level of the directory checked out from CVS with the lib subdirectory containing the other jars it depends on. Then, I was able to run the validator successfully:

C:\Temp\validator\2002\css-验证器> java -jar css-validator.jar http://www.unur.com/

这篇关于有没有可以在本地运行的开源CSS验证器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆