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

Re: No-output identity template?

Subject: Re: No-output identity template?
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 23 Jan 2003 15:07:55 GMT
template re no menu

> I don't know what template or rule is causing its creation,

It's the default element rule in the mode sub-menu

Here

 <xsl:template match="/">
    <xsl:apply-templates mode="sub-menu" />

you apply this mode to all child elements, there is just one, <menu>,
you don't have a template for that so the default gets applied which
just recurses on child nodes, in the same mode.


so now this mode is applied to the two child nodes of menu.

The first is an item containing an item so
  <xsl:template match="item[item]" mode="sub-menu">
applies.

the second is an item not containing an item so none of your templates
applies so the default will fire. This will in turn apply the sub-menu
mode templates to the text node children of the item node and you
get bugs bunny.

so either you want a template for menu in sub-menu that is more careful
in which children it applies templates to, or simpler if it does the job,

  <xsl:template match="item" mode="sub-menu"/>

which will zap all items not covered by the higher priority  match="item[item]" 
template

David

________________________________________________________________________
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.