RE: Using tags within tags

Subject: RE: Using tags within tags
From: Mick <mick@xxxxxxxxxxxx>
Date: Mon, 21 Aug 2000 10:07:58 +0200
Hello Ben, David and Jeni,

Thanks for helping me out with my problem. I have tried all of your
solutions but unfortunately, none of them work. Any idea what's going wrong?
If you have any time to help me sort this out, please contact me off-list -
I could really do with some help.


At 19:58 16/08/00 -0200, David Allouche wrote:
>On Wed, 16 Aug 2000, Ben Robb wrote:
>> <xsl:template match="cap">
>> 	<div>
>> 		<xsl:attribute name="style">
>> 			color:<xsl:value-of select="@color"/>
>> 		</xsl:attribute>
>> 		<xsl:apply-templates/>
>> 	</div>
>> </xsl:template>
>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>

Or, for something as simple as this, you could use an attribute value
template, which is shorter as well as getting rid of whitespace, but a
little less transparent (possibly? - I personally find it easier to read)
and won't work on early versions of MSXML:

<xsl:template match="cap">
  <div style="color:{@colour}">
    <xsl:apply-templates />

I do like the <xsl:text/> trick :)



Jeni Tennison

 XSL-List info and archive:

 XSL-List info and archive:

Current Thread