tags:

views:

70

answers:

1
<a>
 <xsl:attribute name="href">
 <xsl:value-of select="link" />
 </xsl:attribute>
 <xsl:attribute name="target">new</xsl:attribute>
 <xsl:value-of select="title" />
 </a>

Thats my template, and in my code:

 sb.Append("<title>");
 sb.AppendFormat("{0} - {1}", f.UserName, f.PointTypeDesc);
 sb.Append("</title>");
 sb.Append("<link>");
 sb.AppendFormat("{0}", HttpUtility.UrlEncode(url));
 sb.Append("</link>");

url is "http://www.cnn.com"

But it renders as: "http://localhost/http://www.cnn.com"

any ideas?

+1  A: 

It seems to me that the problem must be with HttpUtility.UrlEncode. Have you checked the contents of the xml that you're creating? The XSL looks correct to me, although it could be written more tersely as:

<a href="{@link}" target="new">
  <xsl:value-of select="title"/>
</a>
Richard A