Archive for July 7th, 2008
Retrieving XSL as a string in MOSS 2007
by liquidpooled on Jul.07, 2008, under Microsoft, Office, Sharepoint Server, Visual Studio 2005, Visual Studio 2008, Windows SharePoint Services
There are times as a SharePoint developer when you may want to access some of the built in XSL style sheets that are included with a base publishing installation, such as “TableOfContentsMain.xsl”. To gain access to the string data contained in the XSL style sheet, you can use the following method:
SPContext.GetContext(HttpContext.Current).Web.Site.RootWeb.GetFileAsString("/Style Library/XSL Style Sheets/TableOfContentsMain.xsl")