的XslTransform VS XslCompiledTransformXslTransform、VS、XslCompiledTransform

2023-09-03 03:39:01 作者:苍山有水井却空

的XslTransform似乎是去微软赞成XslCompiledTransform的pcated $ P $。从理论上讲,如果我这样做只是我的应用程序的执行过程中一个转换,不应该跨preting的XSLT(通过的XslTransform)比编译更快?如果是这样,是的XslTransform书面如此糟糕,做了改进XslCompiledTransform不仅仅弥补了它?

XslTransform appears to have been deprecated by Microsoft in favor of XslCompiledTransform. Theoretically, if I was doing just one transform during the execution of my application, shouldn't interpreting the XSLT (through XslTransform) be faster than compiling it? If so, is XslTransform written so badly that the improvements made to XslCompiledTransform more than compensate for it?

推荐答案

您可能希望看到的记载差异的XslTransform XslCompiledTransform 这里和此处,并决定自己

You might want to see the documented differences between XslTransform and XslCompiledTransform here and here, and make the decision yourself.

在此外,有一些情况,其中的XslTransform是更不遵医嘱。更多的工作是在XslCompiledTransform进行安全性。

In addition, there are some cases in which XslTransform is more incompliant. More work was done on security in XslCompiledTransform.

所以,很多的原因之一,应考虑使用新的 XslCompiledTransform 而不是旧的XslTransform 下,即使在变换将只运行一次,并可能与旧的XslTransform略快的情况。

So, a lot of reasons one should consider using the new XslCompiledTransform instead of the old XslTransform, even in cases where the transformation will be run only once and could be slightly faster with the old XslTransform.