[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Selecting only one element using templates
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|