HTML / HTML中的HTML验证器? (不一定是XML) [英] HTML Validator in Javascript/PHP? ( not necessarily XML )

查看:104
本文介绍了HTML / HTML中的HTML验证器? (不一定是XML)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找类似 http://validator.nu/ 的内容,我将验证HTML输入(字符串),我想通知用户如果有任何缺少的结束标签,某个元素是否不能具有某种属性,那么性质(HTML 4.01基本上严格验证)。

I'm looking for something like http://validator.nu/, I'll be validating html input ( string ) and I want to notify the user if there are any missing end tags, whether a certain element can't have a certain attribute, things of that nature ( HTML 4.01 Strict validation basically ).

Sidenote:我不会处理XML / DTD,我不想更正用户输入,如 http://htmlpurifier.org/ 这样做。

Sidenote: I won't be dealing with XML/DTDs, and I don't want to correct the user input like how http://htmlpurifier.org/ does it.

推荐答案

使用官方 W3 Validator SOAP Web服务,因为它远远优于Tidy的警告,只是我需要的完美工具。必须学习一些SOAP和命名空间规则,但值得一试:)

Soo, I ended up using the official W3 Validator SOAP web service because it's far superior to Tidy's warnings and it's just the perfect tool that I needed. Did have to learn some SOAP and namespace rules, but it was worth it :)

这篇关于HTML / HTML中的HTML验证器? (不一定是XML)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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