Inconvenient XHTML validation in Sitecore 8 XP

Inconvenient XHTML validation in Sitecore 8 XP

It’s all about quality

Sitecore is a rich platform with powerful web content management capabilities. One of the standard available features are validators that automatically execute as a part of the publishing workflow. One of the validators that is executed in that process is the Full Page Xhtml validator that checks whether the whole page that is to be published is compliant with XHTML. At first such check seems very useful: after all if your website has been delivered with valid HTML, you will very likely want to keep it that way. Using valid HTML means not only that your web pages will render faster but they will also be rendered as intended by the designers. Invalid HTML often results in browsers using quirks mode rendering where the browser tries to make best out of your HTML. In many cases this leads to rendering inconsistencies across the different browsers but also comparing to the original design. While it almost seems like a no-brainer to use the XHTML validator to validate your pages before publishing, there is one problem with it.

XHTML: do you really want it?

The Full Page Xhtml validator has been designed to validate the conformance of your website with the XHTML standard. The problem with XHTML is that it’s based on XML which isn’t very forgiving and theoretically, whenever there is an error somewhere in the XML, the only thing that is rendered is the error message. Error message rendered for an XML document with an error As you can imagine this behavior is far from desirable on the web. To avoid it in most cases websites using XHTML were served as HTML documents rather than XHTML omitting the strict XML grammar rules and missing the whole point of using XHTML.


The XHTML standard has been originally published in 2000 and many things have changed on the web since then. As the web evolved and new demands emerged, the HTML5 standard has been published. HTML5 not only added new capabilities to HTML but also changed the main philosophy behind HTML. Rather than using the strict XML grammar as XHTML did, HTML5 allows developers to decide for themselves whether they want to have their HTML XML-compliant or not. Either way HTML5 documents are not served as XML and minor errors in the grammar are forgiven without the visitors even noticing them. HTML5 allows for greater flexibility on the web, but also to an issue in Sitecore 8 XP.

Inconvenient HTML5 in Sitecore 8 XP

Consider the following webpage:

<!doctype html>
<p>Hello world</p>

It’s a perfectly valid HTML5 document. If you would however implement this HTML as a layout in Sitecore and would try to approve an item for publishing, all you would see was the following error: Error in the item approval process stating that the item isn’t XHTML compliant As mentioned earlier the Full Page Xhtml validator is by default a part of the publishing workflow and executes every time you approve an item for publishing. As a result you have to ensure that your HTML5 website is XHTML compliant in order to use the publishing workflow or you won’t be able to publish any item!

Disabling XHTML validation

The good news is that Sitecore is a highly customizable platform and nearly everything about it can be configured to meet your needs. This applies also to controlling which validators should be executed as a part of the publishing approval process. If you want more flexibility in the HTML that you are using on your website you can disable the XHTML validation for the publishing approval process. To do this open the Content Editor and in the tree view navigate to the /sitecore/System/Settings/Validation Rules/Global Rules item. Then, in the Validation section, go to the Workflow field and remove the Full Page Xhtml validator from the list of selected validators. The ‘Full Page Xhtml’ validator highlighted in the list of validator selected for the workflow Having this done, save the item to apply the changes. Next time you will approve an item for publishing, the XHTML validation will not be executed and you will be able to publish your items even if your layouts or renderings use non-XHTML compliant HTML markup.


Sitecore tries to help you maintain the quality of your website by automatically validating your HTML when approving items for publishing. If you’re using non-XHTML compliant HTML on your website, the validation process will return an error and will prevent you from publishing items. The XHTML validation process can be disabled giving you the maximum flexibility with regards to building the HTML for your website.


comments powered by Disqus