This question already has an answer here:

I am using Sitecore 8.2 in a Helix configuration and added some custom chrome placeholder styling that I found in the Professional Sitecore 8 Development book. The code works in that I can now see the custom chrome styling, but I am now receiving XHTML validation errors, whereas I wasn't getting these errors before.

XHTML errors

I read that HTML5 tags may cause this kind of XHTML error, but the HTML5 tags I'm currently using were not causing this error before I added the chrome styling.

I also searched for the rendering IDs named in each error in the page source and they were each referring to the <code></code> block that I believe contains the Json for each placeholder.

Does anyone know if the tag is not XHTML compliant? If it is, what can I do about this error?

Update: I've also discovered that when I check the Validation tool in the Home tab in the Proofing section from XP Editor, I have numerous warnings like "Warning: Could not find schema information for the element 'html'." and for every other common html tag.

marked as duplicate by Mark Cassidy Dec 20 '16 at 21:00

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • I don't think its the <code> blocks - IIRC code is a valid XHTML as long as its closed properly. – Richard Seal Dec 13 '16 at 14:26
  • Hmm, it's closed properly. I would also be a little surprised if this is the problem as the placeholders were there prior to adding the chrome styling code. The validation error is just pointing to this section. Everything around it looks fine to me as well, at least in that the other tags are all closed properly as well. Any suggestions on debugging this issue? Thanks! – Iceape Dec 13 '16 at 14:29

This error is detected by Sitecore Javascript code when it is unable to handle tags that are received from server.

Problem is that modern browsers are "too smart" that if they receive wrong XHTML document, e.g. nested P tags:

   text <p>another text</p>

then then will transfer them into two tags on same level:

<p>another text</p>

It causes Sitecore JavaScript code inability to find proper element near CODE tag. And I am not sure if it is possible to fix it from Sitecore side. Check places near mentioned tags on similar problems, refer to https://kb.sitecore.net/articles/365101. Do not use browser developer tools as they show already modified HTML.

  • Thank you for the response. I have already checked this article out and ruled out everything that it mentioned. We are not very far along in development of this site and therefore do not have a lot of html written yet, so it was easy to confirm that all tags are properly closed, as well as no nested P tags, from within the visual studio project. – Iceape Dec 13 '16 at 17:03
  • @Iceape I definitely can say that this error is thrown by Sitecore Javascript. Can you compare HTML code that is received by browser(by Fiddler or viewing source code of page) with code that you see in browser developer tools? – Anton Dec 13 '16 at 17:15
  • As far as I can tell the HTML that I see from viewing the page source is the same as the HTML in IE's browser developer tools. I copied and pasted the code from both sources into validator.w3.org and they both render the same results. There are approximately 180 errors, the first few of which come from XP Editor code that I don't believe I have any control over. The remaining errors (about 170) are "Attribute 'chrometype' not allowed on element 'code' at this point." with the same error for other attributes all on the 'code' element. – Iceape Dec 14 '16 at 9:51

The problem ended up being a typo in my class that disposes the rendering.

The full answer can be seen here: Error Related to GetEnd() Method in a Custom Rendering Wrapper - Sitecore 8.2

Not the answer you're looking for? Browse other questions tagged or ask your own question.