J
joealonso
Problem:
I have an xml news feed:
blah blah yesterday by the news from General Motors (NYSE:GM) that
helped bring the market to a three-week high blah blah We all know that
the old days are gone, when IBM (NYSE:IBM) employees wore dark suits
and ties, and white shirts, worked nine to five blah Procter & Gamble
(NYSEG)
I need to select the text between "NYSE:" and ")" and add <a
href="page.asp?symbol=IBM">$string</a>
does anyone know how to do this? I've got an extra Half-Life2 serial
number for the first person to figure it out.
I've tried something like...
<xsl:template name="links">
<xslaram name="str"/>
<xsl:choose>
<xsl:when test="contains($str,'NYSE')">
<a href="#id{substring-after($str,'NYSE')}"><xsl:value-of
select="substring-after($str,'NYSE')"/></a>
<xsl:call-template name="links">
<xsl:with-param name="str" select="substring-after($str,'NYSE')
and substring-before($str,')')"/>
</xsl:call-template>
</xsl:when>
<xsltherwise>
<xsl:value-of select="$str"/>
</xsltherwise>
</xsl:choose>
</xsl:template>
Thanks in advance!
I have an xml news feed:
blah blah yesterday by the news from General Motors (NYSE:GM) that
helped bring the market to a three-week high blah blah We all know that
the old days are gone, when IBM (NYSE:IBM) employees wore dark suits
and ties, and white shirts, worked nine to five blah Procter & Gamble
(NYSEG)
I need to select the text between "NYSE:" and ")" and add <a
href="page.asp?symbol=IBM">$string</a>
does anyone know how to do this? I've got an extra Half-Life2 serial
number for the first person to figure it out.
I've tried something like...
<xsl:template name="links">
<xslaram name="str"/>
<xsl:choose>
<xsl:when test="contains($str,'NYSE')">
<a href="#id{substring-after($str,'NYSE')}"><xsl:value-of
select="substring-after($str,'NYSE')"/></a>
<xsl:call-template name="links">
<xsl:with-param name="str" select="substring-after($str,'NYSE')
and substring-before($str,')')"/>
</xsl:call-template>
</xsl:when>
<xsltherwise>
<xsl:value-of select="$str"/>
</xsltherwise>
</xsl:choose>
</xsl:template>
Thanks in advance!