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

Re: apply-templates and predicates

Subject: Re: apply-templates and predicates
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 27 Apr 2005 17:33:03 +0100
Re:  apply-templates and predicates
  If you filter on the apply-templates it is unlikely that the default 
  template match will ever get invoked.

If you have templates that match all the elemnts that appear in your
source the default template will not be used, otherwise it will be.
That happens in either style.

Actually it depoends a bit what you mean by default template.
Do you mean the in built default, in my stylesheets that is rarely caused
because I usually start off stylesheets by going
<xsl:template match="*">
<xsl:message>
Unexpected element <xsl:value-of select="name()"/>
</xsl:message>
</xsl:template>

Or by default do you mean any template with a * wildcard whether
explictly in the stylesheet, as above, or the built in one?

  and am looking at ways of making the XSLT as managable as 
  possible.

I find that handling different match patterns to handle the various
special cases is a lot more manageable than using filters on the
select. I mainly use the filter on select idiom if the filter involves a
global parameter to the stylesheet, as XSLT1 restrictions disallowing
variables in match patterns means that is often the best way. In XSLT2
this restriction will be dropped so I'd expect to use the match pattern
version even more often.

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

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.