This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: How to display only certain nodes
- To: "'xsl-list at lists dot mulberrytech dot com'" <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] How to display only certain nodes
- From: Heather Lindsay <heather dot lindsay at Trifolium dot com>
- Date: Wed, 13 Jun 2001 15:25:13 -0400
- Reply-To: xsl-list at lists dot mulberrytech dot com
You want:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:output method="html" indent="no"/>
<xsl:template match="/">
<table width="90%" cellpadding="1" cellspacing="1" border="0">
<xsl:apply-templates select="Message"/>
</table>
</xsl:template>
<xsl:template match="Message">
... HTML to display the message ...
</xsl:template>
</xsl:stylesheet>
By using just <xsl:apply-templates/> you are applying templates to all
elements in the document. If you do not write an <xsl:template ...> for any
existing element then the default template is applied which is printing out
the values of the elements.
-----Original Message-----
From: Scott Zagar [mailto:scottz@fullerene.com]
Sent: Wednesday, June 13, 2001 2:45 PM
To: xsl-list@lists.mulberrytech.com
Subject: [xsl] How to display only certain nodes
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:output method="html" indent="no"/>
<xsl:template match="/">
<table width="90%" cellpadding="1" cellspacing="1" border="0">
<xsl:apply-templates />
</table>
</xsl:template>
<xsl:template match="Message">
... HTML to display the message ...
</xsl:template>
</xsl:stylesheet>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list