[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: nested templates?
Alex,
At 08:58 PM 5/16/01, you wrote: below is a real world example of for-each. (first 'document') this works. I'm puzzled. Why can't a template that's not nested match just fine, be 'imported' just fine, whenever you need it? So <xsl:template match="/"> <xsl:apply-templates/> </xsl:template> <xsl:template match="bookmark"> <output> <xsl:apply-templates/> </output> </xsl:template> The second template will match *any* bookmark element that happens to be picked up by an apply-templates instruction, it doesn't matter where in the tree, how deep, or how many times: it always works the same way. All you need to do is make sure that your xsl:apply-templates call it properly (which is one reason why the built-in defaults provide for a depth-first traversal covering every node). Isn't that exactly what you want? I'm warming up to this language rapidly, after you get over the amazing verbosity of the syntax, it works quite well, actually :) If I'm right and you just haven't 'clicked' with the processing model (and to be sure, alot is under the surface and you have to learn it's there before you can properly see why things work the way they do), you'll soon like it even better. Or to put it in a nutshell, it's not XSLT that's the problem, it's our misplaced assumptions, typically drawn from other programming paradigms, that are getting in the way. Sorry I can't help with the Sablotron stuff. Cheers, Wendell
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|