|
Subject: Re: [xsl] embedding links from xml to html using {} From: "Runni Vermel" <runni@xxxxxxxxxxxxxx> Date: Thu, 26 Jul 2001 15:03:52 -0700 |
damn it, looked at this code for a day and a half before i sent it out, and
15 minutes after i send it - i solve it.
apparently (if you DO wanna hear this), the {venueId} *has to be inside its
parent node's match code*.
ie:
<xsl:template match="venueInfo">
<xsl:apply-templates select="venueId" />
</xsl:template>
wouldn't work. (at least for me and my limited knowledge).
this does work for me now:
<xsl:template match="venueInfo">
<a href="#{venueId}"><xsl:value-of select="venueName" /></a>
</xsl:template>
sorry to waste bandwidth.
if anyone has more insights about how to do this better, it will be much
appreciated.
Runni
----- Original Message -----
From: "Runni Vermel" <runni@xxxxxxxxxxxxxx>
To: <XSL-List@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Thursday, July 26, 2001 2:41 PM
Subject: [xsl] embedding links from xml to html using {}
> so, here's my problem, bear with me since i AM a newbie.
> here goes: my xml tree is as follows:
> <notification>
>
> <event>
> <venueId>457</venueId>
> <bunch of more stuff here></bunch of more stuff>
> </event>
>
> <event>
> <venueId>457</venueId>
> <bunch of more stuff here></bunch of more stuff>
> </event>
>
> <venueInfo>
> <venueId>venueid3</venueId>
> <venueName>venuename3</venueName>
> </venueInfo>
>
> <venueInfo>
> <venueId>venueid3</venueId>
> <venueName>venuename3</venueName>
> </venueInfo>
>
> </notification>
>
> what i wanna do is do this:
> both events have a venueId and both venueInfo also have a venueId. in my
xml
> page, i have a list of events, and the corresponding venues. there will
> always be a match between the event venueId and the venueInto venueId.
(hope
> that made sense).
> so, i'm trying to link the venueName with the venueId as the link as such:
> <a href ="#<venueId />"><xsl:apply-templates select="//venueName"/></a>
>
> yes, i know that isn't correct xsl, i just wanted to explain it in the
> easiest way.
> so, i tried using this:
> <a href ="#{venueId}"><xsl:apply-templates select="//venueName"/></a>
>
> alas, reality (and the parser) laughed in my face - this code is only
> returning the FIRST venueId - it's not going through the xml tree - only
> grabbing the first one...
>
> this is a problem, because even though my sample only has two venueIds, in
> fact, i have allot more.
>
> any suggestions are GREATLY appreciated...
> thanks,
> runni
>
>
> 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 |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| [xsl] embedding links from xml to h, Runni Vermel | Thread | Re: [xsl] embedding links from xml , Kevin Nardi |
| Re: [xsl] embedding links from xml , Kevin Nardi | Date | [xsl] <xml:variable> alternative fo, Nidhi Wadehra |
| Month |