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")
0 Comments.