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

Re: can templates be nested?

Subject: Re: can templates be nested?
From: Joerg Heinicke <joerg.heinicke@xxxxxx>
Date: Sun, 16 Jun 2002 09:41:28 +0200
blackbird templates
Hello Dmitri,

no, templates can not be nested. But therefore you have <xsl:apply-templates/> to apply a template on the selected node. There were you want to have the <a href="mailto:"/>, write <xsl:apply-templates select="../label/person"/>.

But there is one problem, you don't have a <person/> in your xml example. You @email is in the second xml at the <track/>-element. So maybe you only need to write the content of your first template copy to your second one.

(Your code is a little bit confusing.)



dmitri kerievsky wrote:
question is how to transfer the mailto value:

<xsl:template match="catalog/artist/album/label/person">
					<a href="{concat('mailto:', @email)}"> <xsl:value-of select="@name"/>

into this template between a <td></td> :

<xsl:template match="track" mode="TrackDetailForAlbum">
			<xsl:if test="position() mod 2">
				<xsl:attribute name="bgcolor">white</xsl:attribute>
				<xsl:value-of select="."/>
				<xsl:if test="@alternateTake = 'true'"> (alternate take)</xsl:if>
			<!--<td align="left"><xsl:value-of select=@track"/></td>		-->
			<td align="right"><xsl:value-of select="@address"/></td>
			<td align="right"><xsl:value-of select="@telephone"/></td>
			<td align="right"><xsl:value-of select="@web"/></td>
			<td align="right"><xsl:value-of select="@paglgroup"/></td>

this .xml has changed from:

		<name>Miles Davis</name>
			<title>Plays Classic Ballads</title>
			<track time="7:56">Bye Bye Blackbird</track>


<catalog> <artist> <name>m ii</name> <album> <title>NY</title> <label></label> <track address="1 main street" telephone="(3333" email="e@xxxxxxx" web="" group="yes"> joe doe</track>

the idea was to have the track name appear as hyperlink with mailto:e@xxxxxxxx The top template works by itself, but how to include that function inside the track template? Any ideas? Thanks, Dmitri

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

Current Thread


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.
First Name
Last Name
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.