xslt - XslCompiledTransform 最快的内存缓存

标签 xslt xslcompiledtransform

我有一组 xslt 样式表文件。我需要产生最快的 XslConpiledTransform 性能,因此我想在内存中表示这些样式表。

我可以在应用程序启动时将它们作为 IXpathNavigable 加载到内存集合中,然后在每个请求时将每个 IXPAthNavigable 加载到单例 XslCompiledTransform 中。 但这仅适用于没有 xsl:import 或 xsl:include 的 styleshhets。 (Xsl:import 仅适用于文件)。

我还可以将每个模板的许多 XSLCompiledTransform 实例加载到缓存中。合理吗?

还有其他方法吗?哪个最好?提高 MS Xslt 处理器性能的其他技巧是什么?

最佳答案

成功执行 Load() 后在 XslCompiledTransform 的实例上,可以缓存该实例以获得更好的性能

请记住,Load() 是一个非常昂贵的操作。

关于xslt - XslCompiledTransform 最快的内存缓存,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/615991/

相关文章:

c# - 使用 XslCompiledTransform 去除空白

xslt - XSL : Find text not currently in elements and wrap?

xslt - 如何读取 .xsl 文件中的 .properties 文件?

javascript - 通过xslt将xhtml转为javascript输出

.net - 方法名称中的连字符,是否可以在任何 .NET 语言中使用?

xslt - XslCompiledTransform 因堆栈溢出而失败

html - 使用 xsl 为 excel 生成 html 需要更多格式

xml - 计算具有多个条件的 xml 元素

.net - 从 XmlDocument 到 XmlDocument 的 XslCompiledTransform

c# - 具有多个 XML 输入文件的 XSLT 转换