RE: [xsl] xsl <xsl:template match= question

Subject: RE: [xsl] xsl <xsl:template match= question
From: sara.mitchell@xxxxxxxxx
Date: Fri, 14 Jun 2002 13:13:49 -0400
At the very least, the path in the match="" portion of 
the template does not match the actual path you have
shown in your example. What you appear to be missing 
is the the "/" in the path means go down to children -- 
it doesn't have to sort through siblings. So:

* match="catalog/artist/name/album/title/label" 
  is looking for the label element in a structure 
  like this

<catalog>
 	<artist>
 		<name>
	 		<album>
	 			<title>
		 			<label></label>
				</title>
			</album>
		</name>
	</artist>
</catalog>

It looks like what you really want is the attributes 
on the person element. The path to person based on your
example is:

match="catalog/artist/album/label/person"

If you use this, the code to create the Mailto should 
work. 

Sara
> -----Original Message-----
> From: dmitri kerievsky [mailto:dmitrik@xxxxxxxxxxxxxx]
> Sent: Friday, June 14, 2002 7:16 AM
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] xsl <xsl:template match= question 
> 
> 
> this is outputting AB, instead of 
> href="mailto:joe@xxxxxxxx";>joe doe</a>
> how can this line <xsl:template
> match="catalog/artist/name/title/album/label/">
> in the .xsl be changed to do this, without assigning an attribute?
> thx,
> dk
> 
> .xml
> 
> <catalog>
> 	<artist>
> 		<name></name>
> 		<album>
> 			<title>AB</title>
> 			<label>
> 				<person email="joe@xxxxxxxx" 
> name="joe doe"/>
> 			</label>
> 		</album>
> 
> 	</artist>
> 	</catalog>
> 
> 
> .xsl
> 
>  <xsl:template match="catalog/artist/name/title/album/label/">
>          <a href="{concat('mailto:', @email)}"><xsl:value-of 
> select="@name"
> 		/></a>
> 		</xsl:template>
> 
> 
> 
>  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