(...)
<item>
<title>Outbreak news. Avian influenza, Cambodia.</title>
<link>http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=PubMed&list_uids=166
73510</link>
<description>
(...)Outbreak news. Avian influenza, Cambodia.(...)
Wkly Epidemiol Rec. 2006 Mar 31;81(13):117
</description>
<category>Wkly Epidemiol Rec</category>
<guid isPermaLink="false">PubMed:16673510</guid>
<dc:creator />
<geo:lat>11.55</geo:lat>
<geo:long>104.9166667</geo:long>
</item>
<item>
(...)
ok, what's next ?
Using the following XSLT sheet, the new feed can be transformed into a RIS file and imported and shared into connotea, exported to KML for google earth.
See the result in connotea at : http://www.connotea.org//user/testclient/tag/geotagged/date/2006-05-12
<?xml version='1.0' ?>
<xsl:stylesheet
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
xmlns:gml="http://www.opengis.net/gml/"
xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/"
xmlns:georss="http://www.georss.org/georss/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
version="1.0"
>
<xsl:output method='text'/>
<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="rss">
<xsl:apply-templates select="channel"/>
</xsl:template>
<xsl:template match="channel">
<xsl:apply-templates select="item"/>
</xsl:template>
<xsl:template match="item">
<xsl:if test="geo:lat and geo:long">
TY - JOUR
TI - <xsl:value-of select="title"/>
<xsl:call-template name="loop">
<xsl:with-param name="s"><xsl:value-of select="normalize-space(/rss/channel/title)"/></xsl:with-param>
</xsl:call-template>
KW - geotagged
KW - geo:lat=<xsl:value-of select="geo:lat"/>
KW - geo:long=<xsl:value-of select="geo:long"/>
UR - <xsl:value-of select="link"/>
ER -
<xsl:text>
</xsl:text>
</xsl:if>
</xsl:template>
<xsl:template name="loop">
<xsl:param name="s"/>
<xsl:choose>
<xsl:when test="contains(normalize-space($s),' ')">
<xsl:variable name="first" select="normalize-space(substring-before($s,' '))" />
<xsl:variable name="remain" select="normalize-space(substring-after($s,' '))" />
<xsl:if test="string-length($first)>0 and $first!='PubMed:'">
KW - <xsl:value-of select="$first"/>
</xsl:if>
<xsl:if test="string-length($remain)>0">
<xsl:call-template name="loop">
<xsl:with-param name="s"><xsl:value-of select="$remain"/></xsl:with-param>
</xsl:call-template>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<xsl:if test="string-length(normalize-space($s))>0 and $s!='PubMed:'">
KW - <xsl:value-of select="normalize-space($s)"/>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
Very interesting ! But it would be nice to have a display online for several users ... How can you get a direct link into google maps instead of google earth ?
ReplyDeleteI requested that feature on connotea.
ReplyDeleteSee http://www.connotea.org/wiki/RequestTagGoogleMap
Pierre