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

Re: XSLT Output contains the unwanted content of all

Subject: Re: XSLT Output contains the unwanted content of all elements as text
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Thu, 08 Mar 2007 17:03:04 +0100
Re:  XSLT Output contains the unwanted content of all
Florent Georges wrote:
<xsl:template match="*"/>

With the OP example, that will result in no output at all, as the root element will match this template rule and no other processing will be done. But off course that depends on the whole, real stylesheet of the OP. Maybe the following can help him, too:

<xsl:template match="text()"/>

Florent, that is not the case. Though I often use your throw-away template because it is so easy and has clear semantics, the normal precedence rules apply, even if you use the element() constructor for a match (which is, I believe, a bit odd though). The OP had:


<xsl:template match="element(zoo:country)">

which is the long form of saying:


<xsl:template match="zoo:country" >...


and a specific element reference has a higher precedence than a generic one. So, adding something like:


<xsl:template match="*" />


will work, and will still call the appropriate other templates in due cause. In cases where you have large input document with many elements and only a few needs to be processed, I believe that it is a bit faster than the text() node approach (some estimate I like to refer to as running time by granularity approximation, but I may be wrong).


-- Abel

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.