示例#1
0
 public void LoadTemplateTest()
 {
     try
     {
         testSubject.LoadTemplate(templatePath); // test
     } catch (Exception ex)
     {
         Assert.Fail(ex.Message);
     }
 }
示例#2
0
        public string RenderPage(XmlConfig config)
        {
            if (config.templatePath == null)
            {
                throw new ArgumentNullException("Missing xslt template path. Set XsltTemplatePath for ILayoutService in controller's constructor");
            }

            StringWriter writer;

            xmlTransformer.LoadData(config.dataPath);
            xmlTransformer.LoadTemplate(config.templatePath);
            xmlTransformer.TransformTemplate(out writer);

            return(xmlTransformer.DecodeToString(writer));
        }