xmlhack.ru XML-форумы
Обсуждение XML и связанных с ним технологий

В чем разница между xsl:apply-template и xsl:call-template?


Автор Сообщение
Kseniya
Новичок

Зарегистрирован: 19.08.2003
Сообщения: 19

[4930] Пн Сен 01, 2003 14:53
В чем разница между xsl:apply-template и xsl:call-template?
в общем вся суть вопроса в заголовке Smile
В чем разница между xsl:apply-template и xsl:call-template?
olpa
Любитель

Зарегистрирован: 23.04.2002
Сообщения: 981
Откуда: Санкт-Петербург
Посетить сайт автора
[4932] Пн Сен 01, 2003 16:53

Apply-templates вызывает обычные шаблоны, а call-template -- именованные. В выборе между ними я согласен с Jeni Tennison:

Цитата:

... personally, I think that the only time you should use named templates is when the context node, position and size has no influence on the result of the template -- in other words when it's a pure function that computes its results based purely on the parameters that are passed to it. Otherwise, my preference is to use moded matching templates.


Подробности: http://www.dpawson.co.uk/xsl/sect2/bestpractice.html.