Re: how to validate a page which uses SSI

joe and cathy wrote:

> I have a site written in HTML 4.01 and CSS, where most pages use SSI.

Fine.

> I am planning to change it to XHTML 1.0/1.1.

That's not really a validation issue, but I have to say that the idea is 
counter-productive, unless you know that there is some tangible benefit to 
be gained.

> The SSI blocks contain, for example, many img tags, and currently the
> img end tags do not have a "/" character.
>
> How can I validate the pages with the SSI blocks included??

You do that like any other validation: you submit the URL to the validator. 
The validator, just like a browser or a search engine, will get the page 
with SSI instructions performed and won't even know it was processed via 
SSI. That is, they just get the output and work on it.

It would normally be pointless to validate the "SSI source", because it's 
not what you send to browsers. Technically, SSI instructions have the form 
of an SGML (or XML) comment declarationinstruction, which effectively means 
that they are ignored in validation. This means that whatever results from 
them in SSI processing would not be validated at all when validating "SSI 
source".

(The above applies to simple SSI. You can do server-side inclusion with 
other tools, too, with more possibilities and possibly different syntax, 
like PHP syntax. PHP instructions have the form of a processing instruction 
in SGML or XML terms, so they too are ignored in validation.)

> The site is www.stokesleypride.org.uk

The validator reports one warning and two errors. As so often, the warning 
points out the real problem if you know how to interpret it:

START QUOTE
Warning  Line 9, Column 93: NET-enabling start-tag requires SHORTTAG YES

.gle-site-verification" 
content="09ncI33tTWGmtbvxROs3_QC2PwhxMCFJ-G4S2iIHTrY" />
END QUOTE

This really relates to the "/", which magically acts as tag end by SGML 
rules as applicable to HTML 4.01. (This is long story, but if you really 
want to know it, check http://www.cs.tut.fi/~jkorpela/html/empty.html )

The simple conclusion is that you should not mix XHTML syntactic 
specialities into HTML 4.01 documents. Within a single document, use either 
HTML 4.01 or XHTML.

I guess someone has picked the tag from Google instructions, but judging 
e.g. from
http://www.google.com/support/webmasters/bin/answer.py?answer=35638#3
you can just omit the "/" character when using HTML 4.01.

And if you decide to go to XHTML, remember to add the "/" to _all_ so-called 
empty elements (elements with EMPTY declared content) in a document.

-- 
Yucca, http://www.cs.tut.fi/~jkorpela/ 

Received on Wednesday, 31 March 2010 17:11:34 UTC