public static XDocument TransformToXDoc(XmlReader reader, string xslFile, XsltArgumentList args, TransformSetting setting, XmlResolver resolver) { XslCompiledTransform transform = GetTransformFromFile(xslFile, setting); return(TransformToXDoc(reader, transform, args, resolver)); }
public override object Create(string key, params object[] args) { TransformSetting setting = args[0] as TransformSetting; FilesXmlResolver resolver = new FilesXmlResolver(); XsltSettings xsltSetting = setting.NeedEvidence ? XsltSettings.TrustedXslt : XsltSettings.Default; XslCompiledTransform transform = new XslCompiledTransform(); transform.Load(key, xsltSetting, resolver); return(new XsltTransformCacheData(transform, resolver.GetFileNames())); }
public static XDocument TransformToXDoc(XmlReader reader, Type xsltType, XsltArgumentList args, TransformSetting setting) { TkDebug.AssertArgumentNull(reader, "reader", null); TkDebug.AssertArgumentNull(xsltType, "xsltType", null); TkDebug.AssertArgumentNull(setting, "setting", null); XslCompiledTransform transform = GetTransformFromType(xsltType, setting); return(TransformToXDoc(reader, transform, args)); }
private static XslCompiledTransform GetTransformFromType(Type type, TransformSetting setting) { TkDebug.ThrowIfNoAppSetting(); XslCompiledTransform result = null; bool cache = setting.UseCache && BaseAppSetting.Current.UseCache; if (cache) { XsltTransformCacheData data = CacheManager.GetItem("XsltTransformType", type.ToString(), type, setting).Convert <XsltTransformCacheData>(); result = data.Transform; } else { result = new XslCompiledTransform(); result.Load(type); } return(result); }
private static XslCompiledTransform GetTransformFromFile(string xslFile, TransformSetting setting) { TkDebug.ThrowIfNoAppSetting(); XslCompiledTransform result = null; bool cache = setting.UseCache && BaseAppSetting.Current.UseCache; if (cache) { XsltTransformCacheData data = CacheManager.GetItem("XsltTransformFile", xslFile, setting).Convert <XsltTransformCacheData>(); result = data.Transform; } else { result = new XslCompiledTransform(); XsltSettings xsltSetting = setting.NeedEvidence ? XsltSettings.TrustedXslt : XsltSettings.Default; result.Load(new Uri(xslFile).ToString(), xsltSetting, fResolver); } return(result); }
public static XDocument TransformToXDoc(XmlReader reader, Type xsltType, TransformSetting setting) { return(TransformToXDoc(reader, xsltType, null, setting)); }
public static XDocument TransformToXDoc(XmlReader reader, string xslFile, TransformSetting setting) { return(TransformToXDoc(reader, xslFile, null, setting)); }
public static XDocument TransformToXDoc(string xmlStr, string xslFile, XsltArgumentList args, TransformSetting setting) { TkDebug.AssertArgumentNullOrEmpty(xmlStr, "xmlStr", null); TkDebug.AssertArgumentNullOrEmpty(xslFile, "xslFile", null); TkDebug.AssertArgumentNull(setting, "setting", null); XmlReader xml = GetXmlReader(xmlStr); XslCompiledTransform transform = GetTransformFromFile(xslFile, setting); return(TransformToXDoc(xml, transform, args)); }
public static XDocument TransformToXDoc(string xmlStr, string xslFile, TransformSetting setting) { return(TransformToXDoc(xmlStr, xslFile, null, setting)); }
public static string Transform(string xmlStr, Type xsltType, TransformSetting setting) { return(Transform(xmlStr, xsltType, null, setting)); }
public static string Transform(XmlReader reader, Type xsltType, TransformSetting setting) { return(Transform(reader, xsltType, null, setting)); }
public static string Transform(XmlReader reader, string xslFile, TransformSetting setting) { return(Transform(reader, xslFile, null, setting)); }
public static string Transform(XmlReader reader, string xslFile, XsltArgumentList args, TransformSetting setting) { TkDebug.AssertArgumentNull(reader, "reader", null); TkDebug.AssertArgumentNullOrEmpty(xslFile, "xslFile", null); TkDebug.AssertArgumentNull(setting, "setting", null); XslCompiledTransform transform = GetTransformFromFile(xslFile, setting); return(Transform(reader, transform, args)); }
public static string Transform(string xmlStr, string xslFile, TransformSetting setting) { return(Transform(xmlStr, xslFile, null, setting)); }