xsl-list
[Top] [All Lists]

RE: Using keys in templates

2004-07-13 09:37:52
It's almost always better to specify exactly which nodes you want to
process in an <xsl:apply-templates select=""/> then to either use ifs
inside a template or a match on a template.

I don't agree. For example, the problem of deleting selected nodes from a
tree is best solved by using the identity template to apply templates to all
nodes in the tree, and then defining a "do nothing" template rule to process
the exceptions. The "push" model is useful because the rules for processing
each kind of node are associated with that node, and not with each of its
possible parents, and this applies just as much when the required action for
some kinds of nodes is a no-op.

Michael Kay



<Prev in Thread] Current Thread [Next in Thread>