开发者

HTML Parser validate tags

I need html parse which have capability to identify error in generated html and if tags are not closed then close it and return 开发者_高级运维the valid html.

More detail: i am getting data from database and break that record to show partial detail on my website to click on more button then show complete content. After breaking string then validate.

I have already used Html Agility Pack but i am new to use it, if this library solve my issue then guide me how (tutorial) or suggest me another library.


I don't think such a library does exist. The problem is, that some libraries can indeed identify errors in your HTML but they cant fix them for you.

I think using the W3C validator as a service is the best starting point here. There's an open source library which uses the API of the W3C validator to validate a document and gives you the response if it is valid or not as well as errors and warnings. I would start with this and then go on from there.

  • W3C Markup Validator library in C#


Here are a couple of validation programs from the World Wide Web Consortium, the W3C:

Windows: http://validator.w3.org/docs/install_win.html

UNIX / Linux: http://validator.w3.org/docs/install.html

You can also use their web services to validate your CSS, HTML, XML, XHTML, JavaScript and many other web technologies. The W3C is one of the overseers of keeping the Internet highly interoperable and internet devices somewhat compatible with each other.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜