This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: XSLT Processing Model Questions


At 10:06 PM 4/14/2002, you wrote:

>I am specifying a direct path where? in the match attribute of the the 
>first template? all the match values in all the templates in the example 
>stylesheet in section D1 are relative paths.
>
>i do not understand how your answer explains the difference between:
>
><body>
><xsl:apply-templates/>
></body>
>
>and:
>
><h1>
><xsl:apply-templates/>
></h1>

   I haven't seen it mentioned (though it is Monday morning and my eyes are 
yet a little blurry), but I think the implicit select might be throwing you 
a curve.  I'm still learning this myself, but I believe that when you call
<xsl:apply-templates/>
you are actually saying something to the effect of
<xsl:apply-templates select="child::node()"/>

   In the above examples, you're selecting a different set of nodes each 
time you call apply-templates.  The first one applies are relevant 
templates to the children of the current content node and the second tries 
to apply (possibly different) relevant templates to the children of that 
current context node.  Since the call to apply-templates occurs in 
different templates, it's probably safe to say that the "current context 
node" for the first template is completely different from the other.

   If you were to call apply-templates twice in a row in the same template, 
you would get duplicated output (first the complete output of one, then the 
complete output of the second, so something like "abcdeabcde", not 
"aabbccddee").



Greg Faron
Integre Technical Publishing Co.



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]