Hello,
I'm receiving:
'System.Xml.Xsl.XsltException: Missing mandatory attribute 'version'
After I try and run my transformation. I spent a good few days coming
up with the appropriate (I think) methods, and overrides for this task.
I have verified that the source XML and XSL will transform by means of
using the MSXML command line parsing tool (previous version of MSXML
though).
Here is my code:
public XmlDocument xslTransformer(XPathNavigator xNav, XsltArgumentList
xArgs)
{
//get xsl source
XslTransform xslObj = new XslTransform();
//default permission set
Evidence ev = XmlSecureResolver.CreateEvidenceForUrl
(classXSLObjectSource);
PermissionSet ps = SecurityManager.ResolvePolicy(ev);
//modify access for specific domain
// WebPermission myWebPermission = new
WebPermission(NetworkAccess.Connect,
// "http://www.example.com");
// myPermissions.SetPermission(myWebPermission);
//wrap with xmlsecureresolver
XmlUrlResolver urlR = new XmlUrlResolver();
XmlSecureResolver xmlSR = new XmlSecureResolver(urlR,ps);
xslObj.Load(xNav,xmlSR,ev);
StringWriter sWrit = new StringWriter();
//transform the xml
xslObj.Transform(xNav,xArgs,sWrit,xmlSR);
XmlDocument xmlREturn = new XmlDocument();
xmlREturn.Load(sWrit.ToString());
return(xmlREturn);
}
Any ideas?
Thanks,
Karl..