AJH.CMS.WEB.UI.Admin.ManageXSLTemplate_UC.ValidateXSL C# (CSharp) Method

ValidateXSL() private method

private ValidateXSL ( string content ) : void
content string
return void
        private void ValidateXSL(string content)
        {
            string fileName = CMSContext.PortalsPath + "\\" + Guid.NewGuid().ToString() + ".xslt";
            try
            {
                FileStream fs = new FileStream(fileName, FileMode.CreateNew, FileAccess.ReadWrite);
                StreamWriter sw = new StreamWriter(fs);
                sw.Write(content);
                sw.Close();
                fs.Close();

                XslCompiledTransform xslFile = new XslCompiledTransform();
                xslFile.Load(fileName);

                File.Delete(fileName);
            }
            catch (XsltException ex)
            {
                File.Delete(fileName);
                throw ex;
            }
            catch (Exception ex)
            {
                File.Delete(fileName);
                throw ex;
            }
        }
        #endregion