xsl-list
[Top] [All Lists]

Re: [xsl] matching question

2008-08-06 06:26:25
Thanks for your answer. So, if my stylesheet only consists of one template without an apply-templates:

<xsl:template match="node()">
...
</xsl:template>

I guess there's a build-in template with a call of apply-templates so that this template is executed.

If my input is like

<a>
  <b/>
</a>

the above template matches only <a> although <b> is also a node that is "children of some parent". What's the reason for that?

regards,
Garvin



1. For any template rule T to be fired, two conditions must apply:

  (a) someone has to call apply-templates selecting a particular node N

  (b) Node N has to match the match pattern for rule T.

2. The pattern match="node()" is short for match="child::node()". So it
doesn't match all nodes, it only matches nodes that are children of some
parent. That is, it matches elements, text nodes, comments, and processing
instructions, but not attributes, document (=root) nodes, or namespaces.


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

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