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


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


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