I'm trying to create an MVC .Net custom view engine based on Saxon. I'd like to be able to refer to ViewData key/value pairs in my XSLT templates, so following the examples from Saxon, i've added an argument to my transformer like this:
Elsewhere in my C# i've added a ViewData["greeting"] property. Then in my xslt I have
- transformer.SetParameter(new QName("", "ViewData"), XdmAtomicValue.WrapExternalObject(viewContext.ViewData));
but the xsl fails to compile. I don't understand why this won't work. Any bright ideas?
- <span xmlns:mvc="clitype:System.Web.Mvc.ViewDataDictionary">
<x2:value-of select="mvc:greeting($ViewData)" />