4
Vote

Feature Request: Support XML in Razor cshtml files

description

If we want to have an action that returns XML data, we need to either serialize it ourself, or use a cshtml view with XML. If we do the latter, then the editor is not so friendly to the XML data (squiglies, etc.)

comments

radleta wrote Jun 8, 2012 at 11:47 AM

I've also found it has issues with HTML self closing tags. +1 to providing a way to turn validation of the content off. I love the rendering engine as a standalone.

More details on example and behavior: http://stackoverflow.com/questions/10931376/asp-net-mvc-4-and-razor-2-view-engine-no-longer-supports-xml/10935189

radleta wrote Jun 8, 2012 at 11:47 AM

  • EDIT: I meant to say HTML 5 self closing tags (e.g. the link element.) Razor throws a compile error because it strictly enforces HTML 5 element closures.