RE: Compute attribute value from sub-element

Subject: RE: Compute attribute value from sub-element
From: Linda van den Brink <lvdbrink@xxxxxxx>
Date: Tue, 17 Aug 1999 09:54:19 +0200
In this case it would probably have the same result. The difference is,
however, that apply-templates causes a search for the xsl:template
match="description", while value-of just gives the content of the
description element. 

If there isn't one, then a default template is carried out, which causes all
the content to be entered in the result tree. The description element
doesn't have child elements, just content, but if it did the content of the
child elements would also be entered in the result tree. 

If there is a template for description, then that template is carried out.
It could be, for example, that the stylesheet contains a template for the
description element to wrap <b> tags around it. 


-----Original Message-----
From: Richard Heim [mailto:rheim@xxxxxxxxxxxxxxxxxxxxx]
Sent: Monday, August 16, 1999 7:42 PM
To: 'xsl-list@xxxxxxxxxxxxxxxx'
Subject: RE: Compute attribute value from sub-element


I'm new at this so please excuse me if I'm off track, but, I'm confused
about "apply-templates."
Would this do the same:

<xsl:template match="entry">
	<xsl:for-each select="entry">
	<a>
	<xsl:attribute name="href">
http://www.frob.org/search?type=simple&amp;key=<xsl:value-of select="key"/>
|     
	 </xsl:attribute><xsl:value-of select="description"/>
	</a>
	</xsl:for-each>
</xsl:template>


 ,-----
> | <xsl:template match="entry">
> |   <a>
> |     <xsl:attribute name="href">
> |       
> http://www.frob.org/search?> type=simple&amp;key=<xsl:value-of 
> select="key"/>
> |     
> </xsl:attribute>
> |     <xsl:apply-templates match="description"/>
> |   </a>
> | </xsl:template>
> `-----
> 

> -----Original Message-----
> From: Kai.Grossjohann@xxxxxxxxxxxxxxxxxx
> [mailto:Kai.Grossjohann@xxxxxxxxxxxxxxxxxx]
> Sent: Monday, August 16, 1999 12:12 PM
> To: xsl-list@xxxxxxxxxxxxxxxx
> Subject: Re: Compute attribute value from sub-element
> 



...


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


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


Current Thread