Subject: Re: Can a single XPath statement duplicate the functionality of this verbose <xsl:choose> statement?
From: Andrew Welch <andrew.j.welch@xxxxxxxxx>
Date: Mon, 24 Oct 2011 11:55:32 +0100
|
On 24 October 2011 11:31, Mark <mark@xxxxxxxxxxxx> wrote:
> Hi Andrew,
> Thanks for this additional information. I am still trying to learn to view
> problems from a non-C++ perspective. Makes my head hurt :-)
No worries... the whole template matching process takes a while to
get, it did for me anyway.
A general guide is:
- don't use xsl:for-each, use xsl:apply-templates
- don't use named templates, use xsl:apply-templates with a mode
- if a template just contains a choose/when, separate out the branches
into individual templates
- instead of xsl:value-of use xsl:apply-templates
- one large template is bad, lots of specific small templates is good.
--
Andrew Welch
http://andrewjwelch.com
| Current Thread |
Andrew Welch - 24 Oct 2011 10:18:10 -0000
- Mark - 24 Oct 2011 10:31:38 -0000
- Andrew Welch - 24 Oct 2011 10:55:42 -0000 <=
- Mark - 24 Oct 2011 11:06:55 -0000
- Andrew Welch - 24 Oct 2011 11:41:03 -0000
- Mark - 24 Oct 2011 12:33:35 -0000
- Andrew Welch - 24 Oct 2011 13:09:28 -0000
|
|