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

Re: How to display only certain nodes

Subject: Re: How to display only certain nodes
From: Mike Brown <mike@xxxxxxxx>
Date: Wed, 13 Jun 2001 13:24:20 -0600 (MDT)
displaying only current node
Scott Zagar wrote:
> <xsl:template match="/">
> 	<table width="90%" cellpadding="1" cellspacing="1" border="0">
> 		<xsl:apply-templates />
> 	</table>
> </xsl:template>

The xsl:apply-templates instruction is saying to go process all the
children of the node currently being processed (the current node is
the root node, in this case). Either your Topic element is in this
set of children, or you it is being picked up by the default
templates.

The default template for elements just contains <xsl:apply-templates/>.
The default template for text nodes makes a copy of the node. You can
override this template by matching "text()", but the better option is
to stop the descent into that part of the tree in the first place.

Change your <xsl:apply-templates/> above to go from the root node
straight to the Message element nodes.

<xsl:apply-templates select="Topic/Message"/>

   - Mike
_____________________________________________________________________________
mike j. brown, software engineer at  |  xml/xslt: http://skew.org/xml/
webb.net in denver, colorado, USA    |  personal: http://hyperreal.org/~mike/

 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.