Feature #40503

XHTML 5

Added by anybody no-lastname-given about 7 years ago. Updated about 1 year ago.

Status:
Needs Feedback
Priority:
Should have
Assignee:
-
Category:
Frontend
Start date:
2012-09-01
Due date:
% Done:

0%

PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

A general problem of Typo3 is the XHTML support.

If you include some unfinished formats in development like HTML5, you should also include XHTML5 with the correct MIME type (application/xhtml+xml).

XHTML is a development which should not be canceled because of some latest fashion ideas of some companies like google &co, because XML has some advantages against SGML.


Related issues

Related to TYPO3 Core - Task #71687: Make it clear that config.disableCharsetHeader is about a HTTP header Closed 2015-11-19
Related to TYPO3 Core - Feature #67686: Clean way to extract doctype Needs Feedback 2015-06-22

History

#1 Updated by Jigal van Hemert about 7 years ago

  • Status changed from New to Needs Feedback

XHTML support has been improved a lot in TYPO3 4.7. Please report any problems you have!

If I understood correctly XHTML5 is the XML rendering of HTML5, so it is also an "unfinished format in development". XHTML isn't cancelled at all as far as TYPO3 is concerned.
An extra doc type is not problem to add. It is however a feature, so it must wait until 6.1 before it can be included.

One thing is rather unclear to me: an XML document needs a schema or DTD. I couldn't find an official DTD for XHTML5, probably because -- as you indicated -- HTML5 is still a work in progress. Do you know a solution for that?

#2 Updated by anybody no-lastname-given about 7 years ago

According to the main companion for HTML5 in German language (S. Münz / C. Gull: HTML5 Handbuch, Poing 2010 [ISBN 978-3-645-60079-8]), XHTML5 has only a XML declaration, but needs no doctype or DTD.

So the header is only

<?xml version="1.0" encoding="utf-8"?>
<html xmlns="http://www.w3.org/1999/xhtml" lang="de" xml:lang="de">

I made some page, which is accepted by the browsers. I tested also with failure, so that I could be sure, that it is parsed as XML. My TS configuration was:

# doctype:
config.doctype = none

# XHTML conformity:
config.xhtml_cleaning = all

# MIME-Type on application/xhtml+xml:
config.disableCharsetHeader = 1
config.additionalHeaders = Content-Type: application/xhtml+xml;charset=utf-8

# XHTML adjustments:
config.xmlprologue = <?xml version="1.0" encoding="utf-8"?>
config.htmlTag_setParams = xmlns="http://www.w3.org/1999/xhtml" lang="de" xml:lang="de" 

You need only to get used, that only the necessary HTML entities are working, but not additional ones, because there is no DTD.

PS: The Typo3 parser makes still the line

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
although I have disabled and changed the charset header. That makes normally no problems, but looks mot very nice.

PPS: If you need, I can make some additional page, not indexed by google.

PPPS: I am not looking for HTML5 or XHTML5 at the moment, but I think Typo3 should be able to render both formats in the future and not only one of them. At the moment it is very early to use one of them, also the concept of HTML5 has some problematic points. The most validators are not really able to validate HTML5 or even XHTML5.

#3 Updated by Jigal van Hemert about 7 years ago

  • Status changed from Needs Feedback to Accepted
  • Priority changed from Must have to Should have

#4 Updated by Jigal van Hemert about 7 years ago

  • Target version set to 6.1.0

#5 Updated by anybody no-lastname-given almost 6 years ago

Still alive or dead???

Typo3 v6.1 (told target) is out since many months

Even the trick told in #2 is not more working since Typo3 v6, because config.xhtml_cleaning does not more work if config.doctype has no xhtml-version.

The content declaration is still wrong, even when you use config.disableCharsetHeader and your own content type declaration. So the situation is even worse than before one year - CONGRATULATIONS!

PS: XHTML+RDFa 1.0 is also a little bit outdated. The W3C has now XHTML+RDFa 1.1

#6 Updated by Mathias Schreiber almost 5 years ago

  • Target version changed from 6.1.0 to 7 LTS

Just to clear things up:
If we set a target version, this means that it is our goal to achieve this in time, but it is no promised deadline.

From our daily business experience it shows that XHTML5 is less widely used over HTML5, de-prioritizing the issue itself.

No-one is blocking these tickets on purpose, there is just other, more important stuff to do.
You are of course welcome to help out if the matter is pressing to you.

#7 Updated by Thomas Mayer over 4 years ago

Maybe related: When dealing with custom doctype strings, extensions must still determine a defined doctype: #67686 Clean way to extract doctype

#8 Updated by Benni Mack about 4 years ago

  • Target version changed from 7 LTS to 8 LTS

#9 Updated by Riccardo De Contardi almost 3 years ago

  • Target version changed from 8 LTS to 9 LTS

#10 Updated by Oliver Hader about 2 years ago

  • Category changed from 1050 to Frontend

#11 Updated by anybody no-lastname-given almost 2 years ago

And again a step backwards:

The next solution from v7.6 is cancelled in v8.7:

config.xmlprologue = <?xml version="1.0" encoding="utf-8"?>
config.htmlTag_setParams = xmlns="http://www.w3.org/1999/xhtml" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sch="http://schema.org/" xmlns:og="http://ogp.me/ns#" xml:lang="de" 
config.doctype = html5
config.xhtmlDoctype = xhtml_11
config.additionalHeaders = content-type: application/xhtml+xml;charset=utf-8
config.renderCharset = utf-8

is not more working.

Since five years this feature is accepted, but nobody seems to able to make even such a small feature. It is getting even worse from version to version...

#12 Updated by Benni Mack over 1 year ago

  • Status changed from Accepted to Needs Feedback

Picking that one up, although the tone is quite rude here:

So you're saying this is what is necessary in XHTML5:

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

but also we'd need self-closing tags and valid XML (unlike HTML5) - correct?

#13 Updated by Christian Weiske over 1 year ago

- The XMLNS is necessary
- lang and xml:lang is optional
- closing tags is necessary for well-formed XML

#14 Updated by Λάθε βιώσας over 1 year ago

A good page in German is:

http://webkompetenz.wikidot.com/html-handbuch:xhtml-unterschiede and http://webkompetenz.wikidot.com/html-handbuch:dokument-grundgeruest

  • MIME Type MUST be application/xml - everything else is SGML based HTML 5:
    config.additionalHeaders = content-type: application/xhtml+xml;charset=utf-8
  • It needs a XML declaration:
    <?xml version="1.0" encoding="utf-8"?>
  • DOCTYPE declaration is optional but now allowed and not uncommon:
    <!DOCTYPE html>
  • the HTML tag needs namespaces, e.g.:
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sch="http://schema.org/" xmlns:og="http://ogp.me/ns#" xml:lang="de">
  • all tags must be closed:
    <tag></tag>
    or
    <tag />
  • tags and attributes are case sensitive
  • there are no empty attributes
    <tag attribute="attribute" />
  • attributes need always quotation marks
  • in XHTML xml:lang is preffered lang is optional for compatibility reasons but not necessary
  • there are only the general xml entities but not the others HTML entities
    &amp;
    but not
    &nbsp;
  • scripts etc. need a CDATA section, there is no noscript section
  • the order of the tags must be wellformed
  • anchors must be made by the id attribute

A typical header could be like (tested with the W3C validator):

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html> 
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sch="http://schema.org/" xmlns:og="http://ogp.me/ns#" xml:lang="de"> 
    <head> 
        <meta charset="utf-8" />
        <base href="https://www.example.com/" />
        <link rel="shortcut icon" href="/ressources/xxx/template/images/favicon.ico" type="image/x-icon" />
        <title>Herzlich Willkommen</title>
        <link rel="stylesheet" type="text/css" href="typo3temp/Assets/9ec95e9db8.css?1469903300" media="all" />
        <link rel="stylesheet" type="text/css" href="ressources/xxx/lightbox2/css/lightbox.css?1525948469" media="all" />
        <link rel="stylesheet" type="text/css" href="ressources/xxx/template/css/xxx_haupttemplate.css?1528106199" media="all" />
        <script src="typo3temp/Assets/dd82474708.js?1469903300" type="text/javascript"></script>
        <meta name="viewport" content="width=device-width, initial-scale=1" />
        <link rel="contents" href="xxx" />
        <link rel="search" href="xxx" />
        <link rel="index" href="xxx" />
        <meta name="dcterms.publisher" content="xxx" />
        <meta property="dc:publisher" content="xxx" />
        <meta name="designer" content="xxx" />
        <meta name="dcterms.language" content="de" />
        <meta property="dc:language" content="de" />
        <meta name="dcterms.license" content="xxx" />
        <meta property="dc:license" content="xxx" />
        <meta name="dcterms.rights" content="xxx" />
        <meta property="dc:rights" content="xxx" />
        <style type="text/css">
          <![CDATA[
            #mainColumn {
              background:url(ressources/xxx/template/images/hauptfeld_01.jpg);
              background-repeat:no-repeat;
              background-position:bottom;
              background-color:#FEFEFE;
              margin-right: 0px;
              background-size: 100% auto;
            }
          ]]>
        </style>
        <meta name="author" content="xxx" />
        <meta name="dcterms.creator" content="xxx" />
        <meta property="dc:creator" content="xxx" />
        <link rel="canonical" href="xxx"/> 
        <meta name="robots" content="index,follow" />
</head>

#15 Updated by Susanne Moog about 1 year ago

  • Target version changed from 9 LTS to Candidate for Major Version

Also available in: Atom PDF