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

Re: Selecting only one element using templates

Subject: Re: Selecting only one element using templates
From: David Carlisle <davidc@xxxxxxxxx>
Date: Mon, 1 Dec 2003 15:01:04 GMT
using templates in xsl
  Yeah, that's the problem I was having, until I saw that I could apply only
  the template I wanted using the "select" attribute in the apply-templates.

  <xsl:apply-templates select="fruit">


Your terminology is off here which makes me suspect you have the wrong
model of what xslt's doing here. the select attribute on apply-templates
does not relate directly to templates (unlike say the name attribute on
call-template which refers to a named template)  It selects a set of
nodes from the input tree, exactly the same as other select attributes
in xslt as on xsl:value-of or xsl:copy.

Templates are then applied to that set of nodes, and the highest
priority matching templates are applied. (Because of the default
templates, it is always the case that some template will apply to each
nnode in the set). The match attribute for the template that is used may
or may not explictly mention the element matched (fruit here)

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.