Windows Phone Developers

Saturday, October 11, 2008

System.Xml.Xsl.XslTransformException was unhandled - Message="Execution of scripts was prohibited. Use the XsltSettings.EnableScript property to ena

System.Xml.Xsl.XslTransformException was unhandled - Message="Execution of scripts was prohibited. Use the XsltSettings.EnableScript property to enable it. An error occurred at "

private void TransformXML()

{

XslCompiledTransform trans = new XslCompiledTransform();

XsltSettings xslt_set = new XsltSettings();

xslt_set.EnableScript = true;

trans.Load(@"C:\ShasurData\Sample.xslt",xslt_set, new XmlUrlResolver() );

//XsltSettings.TrustedXslt

trans.Transform(@"C:\ShasurData\ForBlogger\Sample.xml", @"C:\ShasurData\ForBlogger\TransformedSample.html");

}

Solution

xslt_set.EnableScript = true;

and pass the xsltsettings to the load method

trans.Load(@"C:\ShasurData\Sample.xslt",xslt_set, new XmlUrlResolver() );





Enable Scripting Error in XSLT Digg Technorati Delicious StumbleUpon Reddit BlinkList Furl Mixx Facebook Google Bookmark Yahoo
ma.gnolia squidoo newsvine live netscape tailrank mister-wong blogmarks slashdot spurl StumbleUpon

No comments:

Post a Comment