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

Re: Can a single XPath statement duplicate the functi

Subject: Re: Can a single XPath statement duplicate the functionality of this verbose <xsl:choose> statement?
From: "Mark" <mark@xxxxxxxxxxxx>
Date: Mon, 24 Oct 2011 04:06:43 -0700
Re:  Can a single XPath statement duplicate the  functi
Hi Andrew,
All of your recommendations made sense to me except this one:

- instead of xsl:value-of use xsl:apply-templates

I have been seeing "value-of" as a kind of "literal print" into the result document. How could "apply-templates" be substituted for it?

Mark

-----Original Message----- From: Andrew Welch
Sent: Monday, October 24, 2011 3:55 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: Can a single XPath statement duplicate the functionality of this verbose statement?


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

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.