Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

loading xslt into .aspx page

Status
Not open for further replies.

AT76

Technical User
Apr 14, 2005
460
US
Hi all,

I'm trying to output an xslt into an .aspx page. Here's my code:

Code:
StringWriter sw = new StringWriter();
        try
        {
            XslCompiledTransform xslt = new XslCompiledTransform();
            xslt.Load(xslPath);
            XmlDocument xdoc = new XmlDocument();
            xDoc.Load(xmlPath);
            xslt.Transform(xDoc, null, sw);
        }

        catch (Exception excp)
        {
            Response.Write(excp.ToString());
        }
        finally
        {
            sw.Close();
        }

However I keep getting the following error message:

System.Xml.Xsl.XslTransformException: Execution of the 'document()' function was prohibited. Use the XsltSettings.EnableDocumentFunction property to enable it.

Does anyone know what this means? If I want to display the XSLT into a portion of my .aspx do I need to add anything else to it? Like a Panel?

Thank you!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top