Rafael wrote:
> I wonder, do you have an example of validated XHTML markup that's not
> "perfect"? I.e. markup that, although validated, it's broken XHTML?
>  Personally, it's all I do, validated as XHTML Strict (after all,
> that's why I'm writing).

I don't have a list of valid but not working XHTML pages.
I also find it hard to create any such pages, since my tools usually
correct my errors even when they are intentional.
Good tools and good knowledge about the standards we're using are worth 
more than the validators, since validators can be easily fooled.

I've quickly prepared a simple example below though, with a mistake my 
tools will allow, which is a pretty common mistake that affects CSS, and 
scripts, directly under the right conditions.

Compare these three pages...
1: <http://www.gunlaug.no/contents/wd_1_06_03-b.html
2: <http://www.gunlaug.no/contents/wd_1_06_03.xhtml>
3: <http://www.gunlaug.no/contents/wd_1_06_03-b.xhtml>

Page no.1 is served as 'text/html', and no.2 and 3 are served as
'application/xhtml+xml'.
You'll see some differences in background colors for the right column
(and maybe a few more differences if you look closely) in the last one.

Those three pages are identical down to one "minor detail", and they are
all valid - according to the validator...
<http://validator.w3.org/check?uri=http://www.gunlaug.no/contents/wd_1_06_03-b.html>
<http://validator.w3.org/check?uri=http://www.gunlaug.no/contents/wd_1_06_03.xhtml>
<http://validator.w3.org/check?uri=http://www.gunlaug.no/contents/wd_1_06_03-b.xhtml>

The "minor detail" is how I've "wrapped" the styles in the page head. In
no.1 and 3 I've used an HTML comment - like found in many valid "XHTML"
pages on the web, while in no. 2 I've used a 'CDATA' "wrapper".

HTML comments _can be removed_ by an XHTML compliant browser when XHTML
is served properly. The styles _inside_ the HTML comment are then also
simply removed, which leads to the different appearance in page no.3.

I don't think that "removal-effect" is intentional in the many XHTML
pages on the web today where HTML comments are used to "comment out"
styles and scripts, and it would also be an unreliable hack as "can be
removed" doesn't mean "must be removed".


- In HTML there's no need/use to "wrap" styles in page-head in anything
but the style-element itself. Same with script-element.
Browsers in need of a comment-wrapper are long dead by now, so don't use
HTML comments to "comment out" styles and scripts.

- In properly served XHTML, a 'CDATA' "wrapper" should be used to tell
the browser to leave that code alone - it isn't part of the mark-up.
Such a 'CDATA' "wrapper" has no use when a page is served as
'text/html', but it does no harm either.

The whole point is that an XHTML page that fails in any way when served 
properly as 'application/xhtml+xml' to compliant browsers, isn't marked 
up properly.
When "minor flaws" like a misplaced HTML comment can lead to failures, 
then one should be pretty careful and neither trust validators nor those 
who give out advices about how to fool the HTML validator in order to 
achieve validity, when dealing with anything named XHTML.

regards
        Georg
-- 
http://www.gunlaug.no
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to