Dave Burke : Freelance .NET Web Developer specializing in Online Communities

Fixing broken image links in ASP.NET RSS content

Nuther geeky sidebar from recent RSS ASP.NET fun.  I was getting broken image links in my syndicated content display and had to sit on it a bit until I arrived at the fix.

The XML content in the feed showed the obvious problem.  Partial URL paths, stripped by CS and other blog applications (as it should be.) 

img src="/images/whatever.jpg"...

I looked at the source in an RSS Bandit reader pane and saw the same partial paths, yet those images were displaying correctly.  Then I saw it.

<base href="http://dbvt.com"> 

That was it.  With XSLT transform, for instance, we'd add a little somethin-somethin' to the XSLT Template.

<base>
  <xsl:attribute name="href">
    <xsl:value-of select="item[$ID]/link" />
  </xsl:attribute>
</base>

The ol' base href trick.  Oldest gag in the book, but still a classic!

Technorati Tags: ,

Comments (0) | Post RSS RSS comment feed

Posted on 12/17/2005 10:10:00 PM by Dave Burke
Categories: .NET
Tags:

Related posts


Powered by BlogEngine.NET 2.0.0.36
Theme by Dave Burke