Wednesday, August 8, 2007

Enabling XSLT scripting in .NET

By default, a .NET XslCompiledTransform does not allow for script execution within an XSL document due to security restrictions. As a result, it is necessary to enable scripting as follows:

transform = new XslCompiledTransform();
settings = new XsltSettings();
stream = new MemoryStream();
settings.EnableScript = true;
transform.Load(transformFilePath, settings, null);
transform.Transform(inputXml, null, stream);

Detailed Article:

No comments: