Welcome to WebmasterWorld Guest from

Forum Moderators: bill & werty

Message Too Old, No Replies

editing link attributes in xsl

3:07 pm on Feb 11, 2005 (gmt 0)

Junior Member from US 

10+ Year Member

joined:June 24, 2003
votes: 0

hey guys, i have a question for someone out there, i did a search here for xsl, and couldnt find what i was looking for. recenty i became familiar with xsl. i have an xml reader that pulls feeds into html. within the script for this reader, it uses an xsl sheet to pull in the link, edit it (formating wise, font, color, spacing) then it pushes it out to the page. this is my question, being new to the xsl format. how do i change the link attributes in xsl before it gets pushed to the html page. here is a snippet of code.

<xsl:template match="/">
<xsl:for-each select="rss/channel/item">
<a href="{link}"><strong><xsl:value-of select="title" /></strong></a>
<xsl:value-of disable-output-escaping="yes" select="description" />

u can see where the link is pulled in, how do i edit the attributes on that link?

2:13 pm on Feb 13, 2005 (gmt 0)

Full Member

10+ Year Member

joined:June 12, 2003
votes: 0

Maybe look here [webmasterworld.com]. if that doesn't answer the question - or even help, try posting your question in that forum.

Sorry I can't be more help. I think all of us in this forum are just a bit thick - or maybe thats just me.

5:06 pm on Feb 17, 2005 (gmt 0)

Junior Member

10+ Year Member

joined:Nov 2, 2004
votes: 0

What do you mean by "attributes of the link?" I think what you mean is you want to add some sort of parameter to the href. You can do that by just adding it as static text.

For instance: <a href="{link}?from=xsl">

On the other hand, if you mean something else, please clarify.

I've been borrowing from [csmonitor.com...] to figure out XSL stuff.