W3C规范Java校验证器:jcabi-w3c
jopen
10年前
该库包含了W3C在线验证的Java适配器:
- HtmlValidator - 校验HTML依据 W3C Markup Validation Service;
- CssValidator - 校验CSS依据 W3C Jigsaw validator.
public class My { public void main() { String xhtml = "<html><body><p>Hello, world!</p></body></html>"; ValidationResponse response = new ValidatorBuilder().html().validate(xhtml); assert response.valid(); } }
public class My { public void main() { String css = "body { font-family: Arial; }"; ValidationResponse response = new ValidatorBuilder().css().validate(css); assert response.valid(); } }