Re: Formatting ASP.NET code

Bjoern Hoehrmann wrote:

> * Tommi wrote:
> 
>>It want's me to specify each ASP.NET control type as it's own tag:
>>asp:literal asp:placeholder and so on. Now for some weird reason all of 
>>the asp tags I have inside the documents <head></head> portion get moved 
>>inside the <body></body> tag after tidying. Am I missing something?
> 
> 
> The problem here is that HTML 4.01 is defined so that any element that
> is not defined to be allowed inside <head> causes the <head> element to
> be closed, the body element be opened and then processed, i.e.

It seems to me that the real problem is that Tommi is trying to use the wrong 
tool for the task. The goal of Tidy is to take "broken" HTML and make it valid 
HTML (or XHTML). Files containing <asp:*> tags are _not_ valid HTML, just as 
files output from M$word which contain <o:*> tags or <v:*> tags are not HTML. 
They may be useful, and they may be valid markup in some scheme that has 
extended HTML, but they are not valid HTML.

A better solution here may be to find a DTD which accounts for .ASP markup, 
and use a generic XML validator. Continuing to extend Tidy to tolerate 
non-HTML markup, no matter how common, does not seem to me to be the best 
approach.

Received on Thursday, 15 July 2004 14:15:44 UTC