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

fallback to a default template in xsl processing

Subject: fallback to a default template in xsl processing
From: "Daly, April" <april@xxxxxxxxxxx>
Date: Thu, 24 Apr 2008 20:29:17 +0100
 fallback to a default template in xsl processing

I have what I hope is a simple question for the xsl/xpath gurus!

I would like to be able to apply a default template within xsl 1.0 if no match
is found. Currently I'm using an ugly  'brute-force' approach using

   <xsl:when test="name()='A' or name()='B'">
      <xsl:apply-templates mode='namedTemplates' select='.'/>
      <xsl:apply-templates mode='defaultTemplates' select='.'/>

this is a simplfied example, but I hope it shows what I'm trying to do.

Is there a better way to apply a named template if 'found' otherwise apply a
default template?

Thanks (in advance) for your help!

April L Daly
Daly Web, Inc.

Current Thread


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.
First Name
Last Name
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.