Skip to content

Commit

Permalink
[#237] Add loction-type selector to isti-xslt.xml and use in Location
Browse files Browse the repository at this point in the history
The conversion used is according to Adrian's second post in issue #237
  • Loading branch information
zzgvh committed Sep 4, 2013
1 parent 16a39ef commit f04c4aa
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions akvo/api/xml/iati-xslt.xml
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@
<object>
<xsl:apply-templates select="coordinates" />
<xsl:apply-templates select="administrative" />
<xsl:apply-templates select="location-type" />
</object>
</xsl:template>

Expand Down Expand Up @@ -253,6 +254,43 @@
</country>
</xsl:template>

<xsl:template match="location-type">
<xsl:apply-templates select="@code"/>
</xsl:template>

<xsl:template match="@code">
<xsl:if test=".='PPLC'">
<city>
<xsl:value-of select="normalize-space(../../name)" />
</city>
</xsl:if>
<xsl:if test=".='PPL'">
<city>
<xsl:value-of select="normalize-space(../../name)" />
</city>
</xsl:if>
<xsl:if test=".='PPLA'">
<city>
<xsl:value-of select="normalize-space(../../name)" />
</city>
</xsl:if>
<xsl:if test=".='PPLA2'">
<city>
<xsl:value-of select="normalize-space(../../name)" />
</city>
</xsl:if>
<xsl:if test=".='ADM1'">
<state>
<xsl:value-of select="normalize-space(../../name)" />
</state>
</xsl:if>
<xsl:if test=".='ADM2'">
<state>
<xsl:value-of select="normalize-space(../../name)" />
</state>
</xsl:if>
</xsl:template>

<!-- goal -->
<xsl:template match="result">
<object>
Expand Down

0 comments on commit f04c4aa

Please sign in to comment.