xsl-list
[Top] [All Lists]

RE: [xsl] matching question

2008-08-06 05:42:16

Two points:

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.

Michael Kay
http://www.saxonica.com/

-----Original Message-----
From: Garvin Riensche [mailto:g(_dot_)riensche(_at_)gmx(_dot_)net] 
Sent: 06 August 2008 11:25
To: XSL Mulberry list
Subject: [xsl] matching question

Hello,

I have a question about the pattern "node()" when used in a 
template "match" Attribute. I thought that it would always 
match all nodes in the source file, but it matches only all 
nodes when the corresponding template is called from 
apply-templates. If it stands alone only the "root" node is 
matched. What's the reason for that behavior? Is it because 
the first matching element is the root element and the others 
are descendants of it?

regards,
Garvin


--~------------------------------------------------------------------
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>
--~--



--~------------------------------------------------------------------
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>