Background
I need to transform an XML Document to an XHTML document for conversion to a DOCX in a MVC3 web application. I will be merging in paragraph text around the XML data. The Paragraph text is extracted from a DB. In the past I would have certainly use XSLT to transform the XML. However I now realise that Razor provides a very compelling/better alternative. My XSLT is a little rusty now, and I will be using Razor heavily in my MVC application anyway. So is Razor the way to go?
If razor is the way to go then I would grateful as to how one would include this in say the controller. My initial pseudocode thoughts are along the line of:
ViewBag.MyXMLDoc = DocXML;
var MyDocXHtml = View("XHtmlRazorRenderer", ParagraphTextListModel);
Thoughts greatly appreciated.
Edit
MyDocument = MyDocument.LoadXML("MyDocXML.xml")
ViewBag.MyDocument = MyDocument;
var MyDocXHtml = View("XHtmlRazorRenderer", ParagraphTextListModel);