0

Possible Duplicate:
HTML doctype for includes (Visual Studio or HTML generic)

I am using T4 to generate a lengthy HTML file. Parts of the included HTML fragments cause validation warnings / error - this is obvious since the includes are just parts of the complete (valid) HTML code.

Can I disable the validation for a particular file? I know how to disable the validation for css / html in general - this is not what I want.

I have tried to rename the include files from .html to something else. However, this disables the validation warnings, but removes proper colouring of the HTML code. Furthermore different XML warnings appear. So this is not the right approach.

Any ideas? PS: ReSharper 7 available, so any solution based on R# is also fine.

Example:I include a list of countries, and the include file just contains the "options". This is where I get the warnings.

Validation of HTML fragments

<optgroup label="Africa">
    <option>North Africa</option>
    <option>South Africa</option>
</optgroup>
....
Community
  • 1
  • 1
Horst Walter
  • 13,663
  • 32
  • 126
  • 228
  • Did you try specifying a different DOCTYPE? – Mikhail Sep 10 '12 at 23:01
  • Sorry, do not really get what you mean. – Horst Walter Sep 10 '12 at 23:22
  • Maybe VS validator will consider the ` ` declaration to relax rules. – Mikhail Sep 10 '12 at 23:27
  • Cool idea! Not working, because what I do is to build one HTML doc from multiple files. So I can include the doctype in the main T4 template, this is where it belongs. I cannot repeat and change it in the includes (it might relax the checks - but it would appear multiple times in the "build" HTML). Good hint anyway. So the problem is the incomplete fragments of HTML where I get the warnings. – Horst Walter Sep 11 '12 at 08:12
  • Will follow up your idea: http://stackoverflow.com/questions/12366426/html-doctype-for-includes – Horst Walter Sep 11 '12 at 09:20
  • How can this be an exact duplicate? Both question from me, within 2 hour. One dealing with the question of how to disable validation for T4 file includes, the other one checking whether the HTML doctype can be used to reach the goal. It's two different approaches for the same problem, but covers completely different ground. – Horst Walter Sep 11 '12 at 15:17

0 Answers0