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

Re: Default Rendering of HTML?

Subject: Re: Default Rendering of HTML?
From: "J.Pietschmann" <j3322ptm@xxxxxxxx>
Date: Sun, 21 Nov 2004 21:35:16 +0100
xslt default rendering
Shawn wrote:
	<xsl:template match="/news">
		<xsl:apply-templates/>
	</xsl:template>

This template is redundant, the XSLT processor already provides such a template for every elemen for you.

	<xsl:template match="item">
		<p>
			<span>
				<xsl:attribute name="class">newsDate</xsl:attribute>
				<xsl:value-of select="date"/>
			</span>

This is overly verbose, writing <span class="newsdate"><xsl:value-of select="date"/></span> should work as well.

<xsl:value-of select="text"/>
This will insert the value of the first text node of the text element
into the result, which is probably white space.
You want
 <xsl>copy-of select="text"/>
here.

Check you favorite XSLT book, one of the online tutorials or
the spec for details of xsl:value-of ann xsl:copy-of (and preferably
xsl:copy too) in order to notice the difference.

J.Pietschmann

Current Thread
  • Default Rendering of HTML?
    • Shawn - 21 Nov 2004 08:13:19 -0000
      • xptm - 21 Nov 2004 13:33:01 -0000
        • Shawn - 21 Nov 2004 20:13:31 -0000
          • J.Pietschmann - 21 Nov 2004 20:35:32 -0000 <=
          • Shawn - 21 Nov 2004 20:46:21 -0000
          • Shawn - 21 Nov 2004 20:43:08 -0000
      • <Possible follow-ups>
      • Passin, Tom - 22 Nov 2004 16:55:34 -0000

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.