[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: XSLT Processing Model Questions

Subject: RE: XSLT Processing Model Questions
From: Greg Faron <gfaron@xxxxxxxxxxxxxxxxxx>
Date: Mon, 15 Apr 2002 09:42:13 -0600
xslt apply template twice
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.