This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: xsl <xsl:template match= question


Thanks for responding. The code using
match="catalog/artist/album/label/person"
does work, except it seems to include the value within title. Is there a way
to avoid this?

Dmitri

-----Original Message-----
From: owner-xsl-list@lists.mulberrytech.com
[mailto:owner-xsl-list@lists.mulberrytech.com]On Behalf Of
sara.mitchell@ps.ge.com
Sent: Friday, June 14, 2002 1:14 PM
To: xsl-list@lists.mulberrytech.com
Subject: RE: [xsl] xsl <xsl:template match= question


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@mindspring.com]
> Sent: Friday, June 14, 2002 7:16 AM
> To: xsl-list@lists.mulberrytech.com
> Subject: [xsl] xsl <xsl:template match= question
>
>
> this is outputting AB, instead of
> href="mailto:joe@here.net";>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@here.net"
> 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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]