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

Re: alternative for modes

Subject: Re: alternative for modes
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 12 Feb 2004 10:35:11 GMT
alternative carlisle
  Imagine this function can be called on a tag <root> and <child> is a child
  of that tag. So each time when 'generalTemplate' is called, a template which
  matches the tag 'child' will be called too:


OK, although xslt can't see any tags in the document, and tags dont have
children (and tags are not the same thing as elements)

< xsl:template match="child">
	<xsl:if test="$p = 'situation1'>

If situation is deducable from the context of the child element node
then a common idiom is to have

 <xsl:template match="foo/child">...
 <xsl:template match="bar/child">...
 <xsl:template match="child[x=y]" priority="2">...

and then you just need 
<xsl:apply-templates/>
in your calling template.

David


-- 
http://www.dcarlisle.demon.co.uk/matthew

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. 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
________________________________________________________________________

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.