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

Re: Suppressing source tree content

Subject: Re: Suppressing source tree content
From: "John E. Simpson" <simpson@xxxxxxxxxxx>
Date: Mon, 12 Apr 1999 13:32:46 -0400
tree content
At 09:22 AM 4/12/1999 -0700, Sara Mitchell wrote:
>I had a problem like this in the prototype I put together. The
>answer I came up with may not be the most elegant, but it worked
>(at least in LotusXsl which is the tool I was using). I simply
>output a comment instead of outputing the content. It looked like
>this: 
>
><xsl:template match="para[@userlevel='NOVICE']">
> <xsl:comment>Novice level information skipped.
> </xsl:comment>
></xsl:template>
>
>[I] wrote:
>> Is there any way to suppress nodes in the source tree so they're not copied
>> to the result?

I did learn something interesting, which led me to a solution. Looked at
the XSL DTD in the Working Draft; it turns out that the <xsl:template>
element may be empty -- that is, that the inclusion of a template (action)
in the template rule is optional. If you use a match pattern with no
template for the element(s) you want to suppress, then nothing is produced
for those element(s). In the case of your example, this would be:

	<xsl:template match="para[@userlevel='NOVICE']">
	</xsl:template>

Actually, I kind of like your idea of a generated comment for some cases,
as it clearly documents in the result tree that something WAS in the source
but is omitted by intent. Thanks for the suggestion.
=============================================================
John E. Simpson          | It's no disgrace t'be poor, 
simpson@xxxxxxxxxxx      | but it might as well be.
                         |            -- "Kin" Hubbard


 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.