XSL Question


I don't know if this is the right place to put this, as the forum called Development seems to be reserved for beta version release announcements. This question is concerning a bit of customization to the atom.xsl file. I'd like to know if there's a way to get the same "base" information in the "/" section as is available lower in the "feed:entry" section. The base is retrieved with this path:

feed:source/feed:link[@rel='alternate'][1]/@href

and gives me (for example) http://www.syrinx.net, but the same (or similar) path doesn't work in the "/" section, even replacing "source" with "feed":

/feed:feed/feed:link[@rel='alternate'][1]/@href

I've tried dozens of combinations, but with no luck. Just using

/feed:feed/feed:link/@href

gives me the URL of the whole feed, not just the base. To be clearer, I'm looking for http://www.syrinx.net, not http://www.syrinx.net/node/feed.

Is there any way of retrieving the feed's base URL from within the "/" section?

Thanks!

A solution

This solution uses the data available to me. It snips the FQ domain name out of the full URL.

<xsl:value-of select="substring-before(substring-after(/feed:feed/feed:link/@href, '//'), '/')"/>

(It should be all on one line, of course.) This turns http://www.syrinx.net/node/feed into www.syrinx.net. Just prepend the protocol string (http://) to complete the base URL. This information was needed for my quest to add per-feed CSS customization to FeedReader without changing FeedReader's source code. Please refer to this thread for the full discussion.