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

RE: Using tags within tags

Subject: RE: Using tags within tags
From: David Allouche <david@xxxxxxxxxxxxxxxx>
Date: Wed, 16 Aug 2000 19:58:46 -0200 (GMT+2)
div unwanted whitespace
On Wed, 16 Aug 2000, Ben Robb wrote:

> <xsl:template match="/">
> 	<html><xsl:apply-templates/></html>
> </xsl:template>
> 
> <xsl:template match="page">
> 	<body><xsl:apply-templates/></body>
> </xsl:template>
> 
> <xsl:template match="line">
> 	<xsl:apply-templates/><br />
> </xsl:template>

Ok.

> <xsl:template match="cap">
> 	<div>
> 		<xsl:attribute name="style">
> 			color:<xsl:value-of select="@color"/>
> 		</xsl:attribute>
> 		<xsl:apply-templates/>
> 	</div>
> </xsl:template>

See my recent post about getting rid of unwanted whitespace.

Date: Tue, 15 Aug 2000 22:56:18 -0200 (GMT+2)
Subject: RE: Including http:// as value of href

The <xsl:attribute> would produce nicer output this way:
(and there was a cultural typo, @color instead of @colour)

	<xsl:attribute name="style">
		<xsl:text/>color:<xsl:value-of select="@colour"/>
	</xsl:attribute>

> <xsl:template match="text()">
> 	<xsl:value-of select="." />
> </xsl:template>

This is not needed.

With the modifications, it becomes:

- - - Stylesheet document - - -
<?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="/">
    <html><xsl:apply-templates/></html>
  </xsl:template>
  
  <xsl:template match="page">
    <body><xsl:apply-templates/></body>
  </xsl:template>

  <xsl:template match="line">
    <xsl:apply-templates/><br />
  </xsl:template>
  
  <xsl:template match="cap">
    <div>
      <xsl:attribute name="style">
	<xsl:text/>color:<xsl:value-of select="@colour"/>
      </xsl:attribute>
      <xsl:apply-templates/>
    </div>
  </xsl:template>

</xsl:stylesheet>
- - - - - - - - - - - - - - - - 

Hope this helps.

                             -- David --



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread
  • Using tags within tags
    • Mick - Wed, 16 Aug 2000 13:05:12 +0200
      • <Possible follow-ups>
      • Ben Robb - Wed, 16 Aug 2000 12:16:36 +0100
        • David Allouche - Wed, 16 Aug 2000 19:58:46 -0200 (GMT+2) <=
          • Jeni Tennison - Wed, 16 Aug 2000 22:05:19 +0100
          • Mick - Mon, 21 Aug 2000 10:07:58 +0200

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.