Converting HTML to Database in XHTML with ASP.NET

I have a large number of incompatible HTML stored in database tables that I need to be validated.

I was thinking about pulling it into a built-in editor like X-Standard that would do the conversion, but is there an easier way to do this with VB.NET?

+1


source to share


3 answers


I would look at HTML Tidy .

From the detailed documentation :



Tidy reads HTML, XHTML, and XML files and writes stripped-down markup. For HTML variants, it detects and fixes many common coding errors and produces visually equivalent markup that is W3C compliant and works on most browsers. A common use of Tidy is to convert plain HTML to XHTML.

+2


source


HTML Tidy is probably the best option.



If for a one-time conversion it might be easier to use a PHP script (where TIDY is inline) to get the job done; otherwise, you will have to wrap the COM object instead in order to use it with VB.NET (more details here if you want to do this.

0


source


By embedding a WYSIWYG editor in the detail page (tinyMCE) I was able to load the bad HTML and let the editor do the job of making the code very close to the actual code.

-1


source







All Articles