Is Rendered Item Valid XHtml Document Could not find schema information warnings during publish item Sitecore 7.2

Note: Since we now live in the HTML5 world, the simple resolution to any XHtml validation errors is to remove the XHtml validation rules on System->Settings->Validation Rules->Global Rules item. Sitecore should update it's validation rules to be relevant to HTML5. This make the rest of this post obsolete :).

I created a simple approval workflow in Sitecore 7.5 and tried to approve an item for publishing and found a bunch of validation errors in the Validation Results. Most of them were related to the "Is Rendered Item Valid XHtml Document" section which looked like this:



The problems were related to violations of the W3C HTML5 recommendation
An important note here is:
The element containing the character encoding declaration must be serialized completely within the first 1024 bytes of the document.

Adding the following xmlns attribute to the Html tag fixed most of the errors:
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
The interesting thing to note is that the Publishing workflow is taking into account some basic HTML validations and won't let you publish items that have invalid XHtml document.

Comments

  1. Hello Varun,

    Thanks for this.

    I was also getting the similar error. And after applying the solution you provided the number of error are reduced to 3.

    Error Message:
    Error: The element cannot contain white space. Content model is empty. [6, 58]

    Error: The element 'http://www.w3.org/1999/xhtml:meta' cannot contain child element 'http://www.w3.org/1999/xhtml:meta' because the parent element's content model is empty. [7, 6]

    Error: The ';' character, hexadecimal value 0x3B, cannot be included in a name. Line 7, position 684. [7, 684]

    Can you please help me to figure out the issue?

    ReplyDelete
    Replies
    1. Thanks I fixed it by following -
      http://stackoverflow.com/questions/8452005/how-do-i-turn-off-xhtml-validation-in-sitecore

      Delete
    2. Nikki - Thanks for the update. I wrote this post long time ago and I while back I figured out that we simply need to disable the XHtml validation since we are now live in the Html5 world. Thanks for bringing it to my attention. Will update this blog post now.

      Delete

Post a Comment

Popular posts from this blog

RESOLVED: Sitecore Solr provider error: Value cannot be null. Parameter name: fieldNameTranslator.

Experience Marketing: The Crawl, Walk, Run of Sitecore - Part 1 - The Crawl Phase