Commit 81f9aa07 authored by Kim Mortimer's avatar Kim Mortimer
Browse files

Removes list of lists, adds instructions, testing of some polygon stuff

parent a2b232b3
......@@ -136,7 +136,7 @@
I use a check for a controlled leading string that would be unlikely to be present in other records. -->
<document>
<xsl:if test="./gmd:identificationInfo/MER:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:otherCitationDetails/gco:CharacterString[starts-with(text(),'MERIDIAN-CITE-AS: ')]">
<xsl:value-of select="./gmd:identificationInfo/MER:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:otherCitationDetails/gco:CharacterString"/>
<xsl:value-of select="substring-after(./gmd:identificationInfo/MER:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:otherCitationDetails/gco:CharacterString, ':')"/>
</xsl:if>
</document>
<uuid>
......@@ -653,21 +653,18 @@
</xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
<!--<xsl:value-of select="($e + $w) div 2"/>,<xsl:value-of select="($n + $s) div 2"/></field>-->
</xsl:for-each>
<xsl:for-each select=".//gmd:EX_BoundingPolygon/gmd:polygon/gml:Polygon">
<xsl:if test="ends-with(@srsName, '84') or ends-with(@srsName, '4326') or not(@srsName)">
<!-- if it's not in WGS 84 we can't convert to geoJson
<!--if it's not in WGS 84 we can't convert to geoJson
if it's a polygon it has an exterior
initialize geoJson
initialize geoJson -->
<geojson>
<xsl:text>{"type": "Polygon",</xsl:text>
<xsl:text>"coordinates": [
[</xsl:text>
[</xsl:text><!--
<xsl:choose>
determine what type of coordinates are being used
<xsl:when test="./gml:exterior/gml:LinearRing/gml:pos">
......@@ -739,12 +736,15 @@
</xsl:choose>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:otherwise>-->
<xsl:text>]</xsl:text>
</xsl:otherwise>
</xsl:choose>
<!--</xsl:otherwise>
</xsl:choose>-->
<xsl:text>] }</xsl:text>
</geojson>-->
</geojson>
<!-- how to determine the average location of a poylgon? -->
<location>
</location>
</xsl:if>
</xsl:for-each>
<xsl:for-each select=".//gmd:EX_BoundingPolygon/gmd:polygon/gml:Point">
......@@ -757,19 +757,24 @@
<xsl:value-of select="concat('[', ./gml:pos, ']')"/>-->
<xsl:text>}</xsl:text>
</geojson>
<location><xsl:value-of select="concat(
number(substring-before(./gml:pos,'&#32;')),
',',
number(substring-before(./gml:pos,'&#32;')))"/></location>
</xsl:if>
</xsl:for-each>
<!-- <xsl:for-each select="./gmd:temporalElement">
<temporalElement>
<xsl:for-each select="./gmd:temporalElement">
<textTemprlElement>
<xsl:for-each select=".//gml:TimeInstant">
<xsl:text>Instant in time </xsl:text>
<xsl:if test="./gml:timePosition[@indeterminatePosition]">
<xsl:value-of select="./gml:timePosition/@indeterminatePosition"/>
</xsl:if>
<xsl:value-of select="./gml:timePosition"/>
</xsl:for-each>
<xsl:for-each select=".//gml:TimePeriod">
<xsl:text>From</xsl:text>
<xsl:text>Time period from </xsl:text>
<xsl:if test="./gml:beginPosition[@indeterminatePosition]">
<xsl:value-of select="./gml:beginPosition/@indeterminatePosition"/>
</xsl:if>
......@@ -780,7 +785,7 @@
</xsl:if>
<xsl:value-of select="./gml:endPosition"/>
</xsl:for-each>
</temporalElement>
</textTemprlElement>
</xsl:for-each>-->
</xsl:for-each>
......@@ -1068,7 +1073,9 @@
select="replace(*[1]/gmd:role/*/@codeListValue, '\s', '')"
as="xs:string?"/>
<xsl:variable name="emailAddress" select="*[1]/gmd:contactInfo[1]/gmd:CI_Contact[1]/gmd:address[1]/gmd:CI_Address[1]/gmd:electronicMailAddress[1]/(gco:CharacterString|gmx:Anchor)" as="xs:string*"/>
<xsl:variable name="phone" select="*[1]/gmd:contactInfo[1]/gmd:CI_Contact[1]/gmd:phone[1]/gmd:CI_Telephone[1]/gmd:voice[1]/(gco:CharacterString|gmx:Anchor)" as="xs:string*"/>
<xsl:variable name="instructions" select="*[1]/gmd:contactInfo[1]/gmd:CI_Contact[1]/gmd:contactInstructions[1]/(gco:CharacterString|gmx:Anchor)" as="xs:string*"/>
<!--<xsl:if test="normalize-space($organisationName) != ''">-->
<xsl:element name="Org{$fieldSuffix}">
<xsl:value-of select="$organisationName"/>
......@@ -1084,16 +1091,24 @@
<xsl:element name="Email{$fieldSuffix}">
<xsl:value-of select="$emailAddress"/>
</xsl:element>
<xsl:element name="Phone{$fieldSuffix}">
<xsl:value-of select="$phone"/>
</xsl:element>
<xsl:element name="Instructions{$fieldSuffix}">
<xsl:value-of select="$instructions"/>
</xsl:element>
<!--</xsl:if>-->
<xsl:choose>
<xsl:when test="normalize-space($organisationName) != '' and normalize-space($individualName) != '' and normalize-space($emailAddress) != ''">
<!--<xsl:choose>
<xsl:when test="normalize-space($organisationName) != '' and normalize-space($individualName) != '' and normalize-space($emailAddress) != ''">-->
<xsl:element name="contact{$fieldSuffix}">{
"person":"<xsl:value-of select="replace($individualName, '&quot;', '\\&quot;')"/>",
"org":"<xsl:value-of select="replace($organisationName, '&quot;', '\\&quot;')"/>",
"role":"<xsl:value-of select="$role"/>",
"email":"<xsl:value-of select="$emailAddress"/>"
"email":"<xsl:value-of select="$emailAddress"/>",
"phone":"<xsl:value-of select="$phone"/>",
"instructions":"<xsl:value-of select="$instructions"/>"
}</xsl:element>
</xsl:when>
<!-- </xsl:when>
<xsl:when test="normalize-space($organisationName) != '' and normalize-space($individualName) = '' and normalize-space($emailAddress) != ''">
<xsl:element name="contact{$fieldSuffix}">{
"org":"<xsl:value-of select="replace($organisationName, '&quot;', '\\&quot;')"/>",
......@@ -1127,6 +1142,6 @@
"role":"<xsl:value-of select="$role"/>"
}</xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:choose>-->
</xsl:template>
</xsl:stylesheet>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment