Ejemplo n.º 1
0
        internal static CacheableXmlDocument CombineModuleXslt(SageContext context)
        {
            CacheableXmlDocument resultDoc = new CacheableXmlDocument();
            resultDoc.LoadXml(DefaultXslt);

            foreach (var moduleKey in context.ProjectConfiguration.Modules.Keys)
            {
                var config = context.ProjectConfiguration.Modules[moduleKey];
                foreach (string path in config.Stylesheets)
                {
                    string stylesheetPath = context.Path.GetModulePath(moduleKey, path);
                    ModuleConfiguration.CopyXslElements(context, stylesheetPath, resultDoc);
                }
            }

            XsltTransform.OmitNamespacePrefixResults(resultDoc);
            return resultDoc;
        }
Ejemplo n.º 2
0
            public override string Apply(string content, SageContext context)
            {
                if (transform == null)
                    transform = XsltTransform.Create(context, path);

                var result = new StringWriter();
                var document = new CacheableXmlDocument();
                document.LoadXml(content);
                document.DocumentElement.AppendChild(context.ToXml(document));

                transform.Transform(document, result, context);
                return result.ToString();
            }