We have two web apps (dxa) "staging" and "active". Both are on IIS on the same server. Same code base for both. Only difference between them is XPM on staging.

We have some content coming from RTF on a page, which has some self closing div tags. The issue is these div tags are behaving differently on staging and active web sites. On staging, they are self closing and on active the div is enclosing the rest of the below content and closing at the end.

Checked all the JS and css and are same for both. If this is HTML5 issue, it should not work on both. Not able to get any clue of why it is not working only on active.

  • 1
    What about the XPM markup then? Looks like that could be your root cause?
    – Nuno Linhares
    Mar 16, 2017 at 13:58
  • Removed XPM, but still the same issue.
    – GVK
    Mar 16, 2017 at 15:33
  • Can you show the View which is generating the div tags? Mar 16, 2017 at 18:37
  • <div class="rtf"> <div @Html.DxaPropertyMarkup(() => Model.Content)> @Html.DxaRichText(Model.Content) </div> </div>
    – GVK
    Mar 16, 2017 at 18:45
  • OK, and what do you mean exactly with "self-closing"? Mar 17, 2017 at 10:04

2 Answers 2


On Staging (or in general, on an XPM-enabled environment), the HTML is post-processed in order to get the XPM markup injected in the right places. See Markup.TransformXpmMarkupAttributes: https://github.com/sdl/dxa-web-application-dotnet/blob/master/Sdl.Web.Mvc/Html/Markup.cs

This explains how there could be differences between Staging and Live (or Active as you call it).

It's still not clear to me which of the two produces the expected output (based on your description, it sounds to me that the Staging output is expected?).


Before DXA is rendering the content, I would like to take a step back and see how the content is stored in the CME and published to the broker. Is the content stored as 'self-closing' tags in the CME itself?

If the above is the case, I would suggest placing an XSLT filter in the CME for that schema and try to align your tags (div, span, anchor etc.) 'correctly' based on the WCAG priorities defined for your schema. I have noticed this behavior in the CME when HTMLTidy is performing its job when updating or creating content in.

Chris has a great starting point HERE.

Keep in mind that HTML source elements on your component is NOT a great idea anyway for technical code and you can keep the schema to 'text' only (without RTF), for these schemas as well. Hope it helps!

Note: You can manipulate the content rendered on the page too but it would be a customization / extension that would impact Core DXA behavior.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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