[Typo3-dev] TYPo3 3.6.0RC1 and XHTML compliance

Simon Child simondt at gpuk.net
Thu Jan 1 01:14:29 CET 2004


I'm trying to validate a template as xhtml transitional and TYPo3 3.6.0RC1
(and earlier versions) seem to break this.

If I set xhtml_cleaning then this line

<?xml version="1.0" encoding="'.$theCharset.'"?>

loses the ? from it's closing >

<?xml version="1.0" encoding="'.$theCharset.'">

and then the validator at validator.w3.org cannot detect the character
encoding.

But if I do not set xhtml_cleaning then typo3 (or perhaps the template
autoparser??) changes some of my closing tags to upper case and so
validation still fails.

Also, if in tslib/class.tslib_pagegen.php line 344 I change <html> to

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

to set the xmlns declaration, then xhtml_cleaning changes this to the
invalid form:

<html xmlns="http://www.w3.org/1999/xhtml" xmllang="en" lang="en">

(xml:lang comes out as xmllang)


Finally, (not sure whether this is significant)
http://www.w3.org/TR/xhtml1/#normative gives the order of the DTD etc as:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">


But TYPo3 3.6.0RC1 gives me (with config.doctype = xhtml_trans):

<!DOCTYPE html
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?xml version="1.0" encoding="iso-8859-1"?>
<html>

This could be amended by reordering these in tslib/class.tslib_pagegen.php
line 324, though as I say I'm not sure whether that matters.


So:

Some fixes are required in tslib/class.tslib_pagegen.php to set the xmlns
declaration, and perhaps to correct the dtd and encoding lines order

Then either xhtml_cleaning needs improving so that it doesn't break these
lines, or typo3 (or autoparser??) needs fixing so that xhtml cleaning isn't
required?

Happy New Year!

--
Simon Child






More information about the TYPO3-dev mailing list