This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: xsl <xsl:template match= question
- From: sara dot mitchell at ps dot ge dot com
- To: xsl-list at lists dot mulberrytech dot com
- Date: Fri, 14 Jun 2002 13:13:49 -0400
- Subject: RE: [xsl] xsl <xsl:template match= question
- Reply-to: xsl-list at lists dot mulberrytech dot com
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