xml editor

Supported platforms

Compatible with Windows7 & Mac OS X Snow Leopard

Ready for data server software
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] How to display only certain nodes


Subject: Re: [xsl] How to display only certain nodes
From: Mike Brown <mike@xxxxxxxx>
Date: Wed, 13 Jun 2001 13:24:20 -0600 (MDT)

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
XML Editor | XML Author | WYSIWYG Editors | Schema Editor | XSD Documentation | XSL/XSLT Editor | XQuery | XML Databases | SVN Client
© 2002-2011 SyncRO Soft Ltd. All rights reserved. | Sitemap | Privacy Policy | This website was created & generated with <oXygen/>®XML Editor