[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Problem with xsl:template using XSLT 1.0
On 04/12/2007, David Carlisle <davidc@xxxxxxxxx> wrote: > <xsl:apply-templates select="some-nodes[@id=current()/@id]"/> > > for example can't so easily be moved down on to the match. Good point - that's also a good example to highlight what I was thinking earlier - when it comes to maintaining a stylesheet is it nicer to have: <xsl:template match="some-nodes[@id = $someID]">... or just <xsl:template match="some-nodes"> ...where the filter is done at select time? The intended use for the template is much more explicit in the former - when you edit that template in the future you know it doesn't get applied to all <some-nodes/>, and you won't be left scratching your head wondering why the template hasn't fired. I guess you can do it in both places - it kind of fits with the 2.0 philosophy of being as restrictive as possible. > Looking down my stylesheets I seem to use both ways (and for-each (and > more and more, for-each-group) in about equal measure. Yep, I would say I do a mix of them all too, for no particular reason. -- Andrew Welch http://andrewjwelch.com Kernow: http://kernowforsaxon.sf.net/
|
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
|