[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: "Roger Glover" <glover_roger@xxxxxxxxx>
Date: Thu, 23 Jan 2003 10:23:43 -0600
output identity
G. Ken Holman wrote:

> At 2003-01-23 09:42 -0500, cknell@xxxxxxxxxx wrote:
> >I have included an XML data document, an XSLT stylesheet, and the
> >resulting output. The XML and XSLT have been severly edited for brevity.
> >The problem I have been working for several hours is the
> >extraneous? "Bugs Bunny" text node output at the end of the output
> >document. I don't know what template or rule is causing its creation,
>
> Your <xsl:apply-templates> in your root node template rule is
> selecting all child nodes because you do not have a select= attribute.
> The <item> is one of the child nodes.  Without a template rule for
> <item>, the built-in  template rules engage and all children are
> processed, which includes text nodes.  Without a template rule for text
> nodes, the built-in template rule is adding the text node to the result.
>
> >I suspect I need some sort of rule with no output, but I haven't
> >been able to discover what the rule should match.
>
> <xsl:template match="menu/item" mode="sub-menu" priority="-1"/>
>
> This will not conflict with match="item[item]" because the inferred
> priority of that rule is ".5".

Is there a reason not just use 'match="item[not(item)]"' instead?  This
seems to me to express the desired behavior more precisely, and it does not
require the priority setting to work correctly in the general case.



 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.