This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: How to display only certain nodes


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]