0

I am receiving a "XML not well formed" error on my webpage in the developer consoles of Firefox and Edge. Chrome works fine and shows nothing. The error message indicates that the XML declaration or the doctype is responsible for this. Here is what I'm using:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html
     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

However, each browser and online XML-parser point to different positions, so I'm not certain where the error lies exactly. For example, Edge gives me line 1, column 68, whereas Firefox points to column 84. The page in question can be found at https://dev.heco.de/. The snippet above is created by the CMS we're using, TYPO3. Even though we're still stuck with an out-dated version, I've checked the snippet of the current version and it's exactly the same.

I am aware that this sort of question has been posted before, and I've read and tried the answers, alas none of them worked for me. Here's what I've tried so far:

  • switched from xml version 1.1 to version 1.0, the error persists
  • switched from double quotes to single quotes
  • omitted the quotes entirely
  • tried using HTML5 instead
  • omitted the xml declaration entirely
  • tried using XHTML transitional instead of strict

None of the above fixed the error, which is why I'm posting this. Since I really can't narrow down the error, I would be really grateful for any kind of advice or insight.

  • https://validator.w3.org/check?uri=https%3A%2F%2Fdev.heco.de%2F&charset=%28detect+automatically%29&doctype=Inline&group=0 – Quentin Sep 24 '18 at 09:49

1 Answers1

0

The validity is not only the header but also the generated HTML.
If you have content mixed from XHTML, html4 and html5 none declaration will match the content.
As @Quentin suggested: get a more detailed analysis from validator.w3.org. Then you might identify the source of invalidation.

The chances are high if you use other templating (marker-templates/ pure typoscript-rendering, where the HTML is added by wraps) that you will have a mix of html/xhtml versions.
Fluid templates by default mostly are html5 conform.

Bernd Wilke πφ
  • 10,390
  • 1
  • 19
  • 38
  • Thanks for the answer. I was afraid that the error is resulting from some other parts of the HTML, because I'm pretty certain that we've got an inconsistent mix of versions there. I was hoping I could narrow it down to the header because the error message of the dev tools said so. I'll look further into w3.org validator, thanks for the hint! – Martin Edelmann Sep 25 '18 at 13:24
  • You might take a copy of the page remove the XML declaration and try a autodetection – Bernd Wilke πφ Sep 25 '18 at 13:28