xsl-list
[Top] [All Lists]

[xsl] Understanding when to use apply-templates with no selector

2011-01-29 16:25:51
I see this a lot:

<xsl:apply-templates />

I have even used it but to be honest, I'm not sure I undertand it
completely.  Given the following xml:

<a>
 <b>
 <c>
 <d>
</a>

If the current context is <a> and you call <xsl:apply-templates />,
the following template matches will hit:
match="a"
match="b"
match="*"  <!-- which picks up on a match of C and D -->

What else gets matched?  If <a> looks like this <a att1="123"
att2="456">, we better have attribute matches too?  What about
comments and processing instructions?  So if you have.
<a>
 <!-- this is a comment --!>
  <?this is a processing instruction?>
  <b>
</a>

Is there a best practice here to mention?

Thanks, just thinking out loud on this.
Karl..



-- 
Karl Stubsjoen
MeetScoresOnline.com
(602) 845-0006

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