How to disable validation for content before <html> ?

For technical support for all editions of CSE HTML Validator. Includes bug reports.

How to disable validation for content before <html> ?

Postby Thomas » Fri Aug 22, 2008 7:01 am

Hello everyone,

I'm making a lot of email templates like this:
Code: Select all
From: "myCompany" <mail@mycompany.com>
...
Content-Type: multipart/alternative; boundary="----FOO"
MIME-Version: 1.0

This is a multi-part message in MIME format.

------FOO
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 8bit

...Plaintext version...
----FOO
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: 8bit

<html>
  <!-- HTML content -->
</html>

----FOO--


I use CSE HTML Validator Pro 7.01 for validation of the HTML code. Is there a way to disable validation for the non-HTML part?

Thanks in advance,
Thomas
Last edited by Thomas on Fri Aug 22, 2008 2:49 pm, edited 1 time in total.
Thomas
Rank 0 - Newcomer
Rank 0 - Newcomer
 
Posts: 3
Joined: Fri Aug 22, 2008 6:53 am

Postby Albert Wiersch » Fri Aug 22, 2008 1:58 pm

Hi Thomas,

You may want to try the "cseignore" element:
http://www.htmlvalidator.com/CSEForum/v ... .php?t=144

Perhaps you could put it in comments with <!-- ... -->.

If you get a message like this:
Code: Select all
The "html" element cannot be used here. It is not contained in an element that allows its use. This element may be contained in "(first tag)".


Then you can check the "(first tag) can be anywhere" option in the Validator 2 tab in the Validator Engine Options.

Then you might also get this message:
Code: Select all
[24] A document type declaration should appear as the first line (line 1) of every HTML document...


Which you should be able to ignore or disable.

Unfortunately there is no easy option to do this, but I will make a note to possible add this as a new feature in a future version.
Image
Albert Wiersch
User avatar
Albert Wiersch
Site Admin
Site Admin
 
Posts: 2439
Joined: Sat Dec 11, 2004 10:23 am
Location: Near Dallas, TX

Postby Thomas » Fri Aug 22, 2008 2:39 pm

Hi Albert,
thanks for your quick reply!

Albert Wiersch wrote:You may want to try the "cseignore" element:
http://www.htmlvalidator.com/CSEForum/v ... .php?t=144

Perhaps you could put it in comments with <!-- ... -->.

Unfortunately, that is not an option. I'm looking for a way to validate the template without modifying it. HTML comments or additional tags in the non-HTML component would render the template useless since our mail distribution system cannot handle them.

I think I'll stick with my current approach: I simply ignore any warnings and errors before the HTML part :wink:
(This might be of interest to some readers: I tried the following workaround: add <mail@mycompany.com> as a "doesn't-require-end-tag" HTML tag in the Configuration Editor! This suppresses most error messages from the second line on. However, I'm still getting some warnings so I decided not to keep using this dirty hack.)

[...] I will make a note to possible add this as a new feature in a future version.

:D I'd really appreciate that.

Thanks again, Thomas
Thomas
Rank 0 - Newcomer
Rank 0 - Newcomer
 
Posts: 3
Joined: Fri Aug 22, 2008 6:53 am

An alternate approach

Postby MikeGale » Sun Aug 24, 2008 6:04 pm

Hi Thomas,

An interesting situation.

I don't do the same as you but here's an alternate work flow that might help. (It's how I tackle some analogous work.)

Have the templates in two parts:

The *.mail bit and the *.htm bit. (Where * is the same for easy identification of matching parts.)

The *.htm can be more easily validated by CSE.

The two parts can be kept in synch with a diff tool, if you edit.

(An additional option is to create a script that extracts the *.htm part to file, if you want to use that system for existing content.)
User avatar
MikeGale
Rank VI - Professional
Rank VI - Professional
 
Posts: 612
Joined: Mon Dec 13, 2004 2:50 pm
Location: Tannhauser Gate

Postby Thomas » Mon Aug 25, 2008 4:38 am

Hi Mike,

thanks for your suggestion.

First of all let me mention that I work as a producer at a large ISP and the mail templates pass through several departments (production, editorial, quality assurance, implementation) - and all of them use CSE Validator Pro.

MikeGale wrote:Have the templates in two parts:...

Nope. :? I'm obliged to work on a single file. The work flow has been established for a long time and there's probably no way to change it.

Some of my colleagues use cut-and-copy-and-paste-methods but this is not really satisfactory to me ;)
Thomas
Rank 0 - Newcomer
Rank 0 - Newcomer
 
Posts: 3
Joined: Fri Aug 22, 2008 6:53 am


Return to CSE Tech Support

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 2 guests