From: <sp...@us...> - 2012-02-27 09:17:25
|
Revision: 8728 http://geonetwork.svn.sourceforge.net/geonetwork/?rev=8728&view=rev Author: sppigot Date: 2012-02-27 09:17:18 +0000 (Mon, 27 Feb 2012) Log Message: ----------- Add subtemplate processing for iso19139.mcp Modified Paths: -------------- schemaPlugins/trunk/iso19139.mcp/present/metadata-iso19139.mcp.xsl Added Paths: ----------- schemaPlugins/trunk/iso19139.mcp/present/metadata-iso19139.mcp-subtemplates.xsl Added: schemaPlugins/trunk/iso19139.mcp/present/metadata-iso19139.mcp-subtemplates.xsl =================================================================== --- schemaPlugins/trunk/iso19139.mcp/present/metadata-iso19139.mcp-subtemplates.xsl (rev 0) +++ schemaPlugins/trunk/iso19139.mcp/present/metadata-iso19139.mcp-subtemplates.xsl 2012-02-27 09:17:18 UTC (rev 8728) @@ -0,0 +1,30 @@ +<xsl:stylesheet version="2.0" xmlns:xsl ="http://www.w3.org/1999/XSL/Transform" + xmlns:mcp="http://bluenet3.antcrc.utas.edu.au/mcp" + xmlns:gmd="http://www.isotc211.org/2005/gmd" + xmlns:gco="http://www.isotc211.org/2005/gco" + xmlns:geonet="http://www.fao.org/geonetwork" + exclude-result-prefixes="mcp gmd gco geonet"> + + <!-- Subtemplate mode - overrides for iso19139 are placed in here + --> + <xsl:template name="iso19139.mcp-subtemplate"> + <xsl:variable name="mcpElements"> + <xsl:apply-templates mode="iso19139.mcp-subtemplate" select="."/> + </xsl:variable> + + <xsl:choose> + <xsl:when test="normalize-space(geonet:info/title)!=''"> + <title><xsl:value-of select="geonet:info/title"/></title> + </xsl:when> + <xsl:when test="count($mcpElements/*)>0"> + <xsl:copy-of select="$mcpElements"/> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates mode="iso19139-subtemplate" select="."/> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <xsl:template mode="iso19139.mcp-subtemplate" match="*"/> + +</xsl:stylesheet> Modified: schemaPlugins/trunk/iso19139.mcp/present/metadata-iso19139.mcp.xsl =================================================================== --- schemaPlugins/trunk/iso19139.mcp/present/metadata-iso19139.mcp.xsl 2012-02-27 09:07:56 UTC (rev 8727) +++ schemaPlugins/trunk/iso19139.mcp/present/metadata-iso19139.mcp.xsl 2012-02-27 09:17:18 UTC (rev 8728) @@ -13,6 +13,7 @@ <xsl:import href="metadata-taxonconcepts.mcp.xsl"/> <xsl:import href="metadata-iso19139.mcp-fop.xsl"/> + <xsl:import href="metadata-iso19139.mcp-subtemplates.xsl"/> <xsl:variable name="mcpallgens" select="document('../schema/resources/Codelist/mcp-allgens.xml')"/> @@ -1801,10 +1802,18 @@ <xsl:template match="iso19139.mcpBrief"> <metadata> <xsl:for-each select="/metadata/*[1]"> - <!-- call iso19139 brief --> - <xsl:call-template name="iso19139-brief"/> - <!-- now brief elements for mcp specific elements --> - <xsl:call-template name="iso19139.mcp-brief"/> + <xsl:choose> + <xsl:when test="geonet:info/isTemplate='s'"> + <xsl:call-template name="iso19139.mcp-subtemplate"/> + <xsl:copy-of select="geonet:info" copy-namespaces="no"/> + </xsl:when> + <xsl:otherwise> + <!-- call iso19139 brief --> + <xsl:call-template name="iso19139-brief"/> + <!-- now brief elements for mcp specific elements --> + <xsl:call-template name="iso19139.mcp-brief"/> + </xsl:otherwise> + </xsl:choose> </xsl:for-each> </metadata> </xsl:template> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |