Performance: call-template vs apply-template

后端 未结 3 608
闹比i
闹比i 2021-01-31 03:24

in XSLT processing, is there a performance difference between apply-template and call-template? In my stylesheets there are many instances where I can use either, which is the b

3条回答
  •  南方客
    南方客 (楼主)
    2021-01-31 04:01

    It may depend on the xml parser you are using. I can't speak for anything but .NET 2003 parser where I did some informal performance tests on push vs pull XSLT code. This is similar to what you are asking: apply-template = push and call-template = pull. I was convinced push would be faster, but that was not the case. It was about even.

    Sorry I don't have the exact tests now. I recommend trying it out with your parser of choice and see if there is any major difference. My bet is there won't be.

提交回复
热议问题