evaluate.xsl 4.65 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright (C) 2001-2016 Food and Agriculture Organization of the
  ~ United Nations (FAO-UN), United Nations World Food Programme (WFP)
  ~ and United Nations Environment Programme (UNEP)
  ~
  ~ This program is free software; you can redistribute it and/or modify
  ~ it under the terms of the GNU General Public License as published by
  ~ the Free Software Foundation; either version 2 of the License, or (at
  ~ your option) any later version.
  ~
  ~ This program is distributed in the hope that it will be useful, but
  ~ WITHOUT ANY WARRANTY; without even the implied warranty of
  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  ~ General Public License for more details.
  ~
  ~ You should have received a copy of the GNU General Public License
  ~ along with this program; if not, write to the Free Software
  ~ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  ~
  ~ Contact: Jeroen Ticheler - FAO - Viale delle Terme di Caracalla 2,
  ~ Rome - Italy. email: geonetwork@osgeo.org
  -->

<!-- WARNING Do not remove those namespaces as
     saxon:evaluate needs them for matching -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:xs="http://www.w3.org/2001/XMLSchema"
                xmlns:gmd="http://www.isotc211.org/2005/gmd"
                xmlns:gts="http://www.isotc211.org/2005/gts"
                xmlns:gco="http://www.isotc211.org/2005/gco"
                xmlns:gmx="http://www.isotc211.org/2005/gmx"
                xmlns:srv="http://www.isotc211.org/2005/srv"
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                xmlns:gml="http://www.opengis.net/gml"
ByronCinNZ's avatar
ByronCinNZ committed
36
		xmlns:mcp="http://bluenet3.antcrc.utas.edu.au/mcp"
37 38 39 40 41 42 43 44 45
                xmlns:xlink="http://www.w3.org/1999/xlink"
                xmlns:gn="http://www.fao.org/geonetwork"
                xmlns:gn-fn-metadata="http://geonetwork-opensource.org/xsl/functions/metadata"
                xmlns:gn-fn-iso19139="http://geonetwork-opensource.org/xsl/functions/profiles/iso19139"
                xmlns:saxon="http://saxon.sf.net/"
                version="2.0"
                extension-element-prefixes="saxon"
                exclude-result-prefixes="#all">

ByronCinNZ's avatar
ByronCinNZ committed
46 47
  <xsl:import href="../../iso19139/layout/evaluate.xsl"/>
  
48

ByronCinNZ's avatar
ByronCinNZ committed
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
  
  <!-- <xsl:include href="layout.xsl"/>
    Load the schema configuration for the editor.
      -->
  <!--<xsl:template name="get-iso19139.mcp-1.4-configuration">
    <xsl:copy-of select="document('config-editor.xml')"/>
   </xsl:template>Byron - Copied over from dipatch.xsl. Threw errors. Comment out.
-->


	<!-- The main dispatch point - process in iso19139.mcp mode first,
	     if we get something then use that otherwise process in iso19139
			 mode -->
 <!-- <xsl:template name="dispatch-iso19139.mcp-1.4">
    <xsl:param name="base" as="node()"/>
    <xsl:param name="overrideLabel" as="xs:string" required="no" select="''"/>
</xsl:template> Byron - Copied over from dipatch.xsl. Threw errors. Comment out.
-->

		<!-- process in iso19139 mode - but we can override any templates
		     defined for iso19139 by importing that stylesheet into our
				 mcp stylesheet - that way the iso19139 templates will have
				 a lower priority than ours -->
 <!--   <xsl:apply-templates mode="mode-iso19139" select="$base">
     	<xsl:with-param name="overrideLabel" select="$overrideLabel"/>
      <xsl:with-param name="schema" select="$schema"/>
      <xsl:with-param name="labels" select="$iso19139.mcp-1.4labels"/>
    </xsl:apply-templates>

  </xsl:template> Byron - Copied over from dipatch.xsl. Threw errors. Comment out.
  -->
80 81 82 83 84

  <!-- The following templates usually delegates all to iso19139. -->
  <xsl:template name="evaluate-iso19139.mcp-1.4">
    <xsl:param name="base" as="node()"/>
    <xsl:param name="in"/>
ByronCinNZ's avatar
ByronCinNZ committed
85 86 87 88 89 90 91 92 93 94 95 96
    

    <xsl:variable name="nodeOrAttribute" select="saxon:evaluate(concat('$p1', $in), $base)"/>
    <xsl:choose>
      <xsl:when test="$nodeOrAttribute/*">
        <xsl:copy-of select="$nodeOrAttribute"/>
      </xsl:when>
      <xsl:otherwise>
        <xsl:value-of select="$nodeOrAttribute"/>
      </xsl:otherwise>
    </xsl:choose>
    <!--<xsl:call-template name="evaluate-iso19139">
97 98
      <xsl:with-param name="base" select="$base"/>
      <xsl:with-param name="in" select="$in"/>
ByronCinNZ's avatar
ByronCinNZ committed
99
    </xsl:call-template>-->
100 101 102
  </xsl:template>

  <xsl:template name="evaluate-iso19139.mcp-1.4-boolean">
ByronCinNZ's avatar
ByronCinNZ committed
103 104 105 106 107 108 109
    <xsl:param name="base" as="node()"/>
    <xsl:param name="in"/>

    <xsl:call-template name="evaluate-iso19139-boolean">
      <xsl:with-param name="base" select="$base"/>
      <xsl:with-param name="in" select="$in"/>
    </xsl:call-template>
110
  </xsl:template>
ByronCinNZ's avatar
ByronCinNZ committed
111 112


113
</xsl:stylesheet>