Fix Guid isPermalink

From AwasuWiki
Revision as of 11:47, 10 August 2009 by Taka (talk | contribs) (New page: Items in RSS (but not Atom) feeds can have a unique ID assigned to them by the publisher using the <tt><guid></tt> tag. A common mistake publishers make is to forget that this tag ha...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Items in RSS (but not Atom) feeds can have a unique ID assigned to them by the publisher using the <guid> tag. A common mistake publishers make is to forget that this tag has an isPermalink attribute that defaults to true, which causes Awasu to treat the ID as the item's URL. If the ID is not actually a URL then strange things will happen, typically clicking on an item will take you to somewhere on on your local hard drive e.g. file:///C:/Documents%20and%20Settings/YOUR-NAME/Local%20Settings/Temp/SOMETHING-HERE.

This problem can be fixed by applying an XSLT to the feed that goes through each item and sets isPermalink to false for each one.

Save the following code in a file on your computer e.g. fixGuidIsPermalinks.xsl

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" />

<xsl:template match="node()|@*">
   <xsl:copy>
       <xsl:apply-templates select="@*" />
       <xsl:apply-templates />
   </xsl:copy>
</xsl:template>

<xsl:template match="guid">
    <xsl:copy>
    <xsl:attribute name="isPermalink">
        <xsl:text>false</xsl:text>
    </xsl:attribute>
    <xsl:apply-templates />
    </xsl:copy>
</xsl:template>

</xsl:stylesheet>

Open the channel's Properties dialog, go to the Details page and click on Processing. Add the XSLT you just saved above to the processing chain, then update the channel.