View stylesheet

XML schema http://dd.eionet.europa.eu/schemas/WFD2022/GML_RiverBasinDistrict_2022.xsd
Output type HTML
Description HTML preview
XSL file RiverBasinDistrict2022.xslt (Last modified: 16 Jun 2021 13:43 )
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:wfdgml="http://dd.eionet.europa.eu/schemas/WFD2022/wfdgml" version="2.0">
	<xsl:output method="html" indent="yes"/>
	<xsl:template match="/">
		<html>
			<head>
				<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
				<title>RiverBasinDistrict</title>
			</head>
			<body>
				<h1>RiverBasinDistrict</h1>
				<table border="1" style="border-collapse:collapse;">
					<xsl:apply-templates select="wfdgml:FeatureCollection/wfdgml:featureMember/wfdgml:RiverBasinDistrict"/>
				</table>
			</body>
		</html>
	</xsl:template>
	<xsl:template match="wfdgml:FeatureCollection/wfdgml:featureMember/wfdgml:RiverBasinDistrict">
		<xsl:if test="position()=1">
			<xsl:call-template name="header"/>
		</xsl:if>
		<tr>
			<td>
				<xsl:value-of select="wfdgml:inspireIdLocalId"/>
			</td>
			<td><xsl:value-of select="wfdgml:inspireIdNamespace"/></td>
			<td><xsl:value-of select="wfdgml:inspireIdVersionId"/></td>
			<td><a target="_blank" href="{concat('https://dd.eionet.europa.eu/vocabularyconcept/wise/SpatialUnit/', wfdgml:thematicIdIdentifierScheme, '.', wfdgml:thematicIdIdentifier)}"><xsl:value-of select="wfdgml:thematicIdIdentifierScheme"/>.<xsl:value-of select="wfdgml:thematicIdIdentifier"/></a></td>
			<td><xsl:value-of select="wfdgml:beginLifespanVersion"/></td>
			<td><xsl:value-of select="wfdgml:endLifespanVersion"/></td>
			<td>
				<xsl:choose>			
					<xsl:when test="wfdgml:predecessorsIdentifier != ''">
		                <xsl:call-template name="tokenizeString">
		                    <xsl:with-param name="list" select="wfdgml:predecessorsIdentifier"/>
		                    <xsl:with-param name="delimiter" select="','"/>
		                    <xsl:with-param name="scheme" select="wfdgml:predecessorsIdentifierScheme"/>
		                </xsl:call-template>
		            </xsl:when>	
				</xsl:choose>		         		
			</td>			
			<td>
				<xsl:choose>			
					<xsl:when test="wfdgml:successorsIdentifier != ''">
		                <xsl:call-template name="tokenizeString">
		                    <xsl:with-param name="list" select="wfdgml:successorsIdentifier"/>
		                    <xsl:with-param name="delimiter" select="','"/>
		                    <xsl:with-param name="scheme" select="wfdgml:successorsIdentifierScheme"/>
		                </xsl:call-template>
		            </xsl:when>	
				</xsl:choose>		            			
			</td>				
			<td><xsl:value-of select="wfdgml:wiseEvolutionType"/></td>	
			<td><xsl:value-of select="wfdgml:nameTextInternational"/></td>	
			<td><xsl:value-of select="wfdgml:nameText"/></td>	
			<td><xsl:value-of select="wfdgml:nameLanguage"/></td>	
			<td><xsl:value-of select="wfdgml:designationPeriodBegin"/></td>
			<td><xsl:value-of select="wfdgml:designationPeriodEnd"/></td>
			<td><xsl:value-of select="wfdgml:zoneType"/></td>
			
			<td><xsl:value-of select="wfdgml:legalBasisName"/></td>
			<td>
				<xsl:choose>
			    <xsl:when test="wfdgml:legalBasisLink != ''">
			        <a target="_blank" href="{wfdgml:legalBasisLink}"><xsl:value-of select="wfdgml:legalBasisLink"/></a>
			    </xsl:when>
			</xsl:choose>
			</td>
			<td><xsl:value-of select="wfdgml:legalBasisLevel"/></td>
			<td>
			<xsl:choose>			
					<xsl:when test="wfdgml:relatedZoneTransboundaryIdentifier != ''">
		                <xsl:call-template name="tokenizeString">
		                    <xsl:with-param name="list" select="wfdgml:relatedZoneTransboundaryIdentifier"/>
		                    <xsl:with-param name="delimiter" select="','"/>
		                    <xsl:with-param name="scheme" select="wfdgml:relatedZoneTransboundaryIdentifierScheme"/>
		                </xsl:call-template>
		            </xsl:when>	
				</xsl:choose>
			</td>
			<td><xsl:value-of select="wfdgml:sizeValue"/></td>
			<td><xsl:value-of select="wfdgml:sizeUom"/></td>
			<td>
			<xsl:choose>
			    <xsl:when test="wfdgml:link != ''">
			        <a target="_blank" href="{wfdgml:link}"><xsl:value-of select="wfdgml:link"/></a>
			    </xsl:when>
			</xsl:choose>
			</td>
		</tr>
	</xsl:template>
	<xsl:template name="header">
		<tr>
			<th>inspireIdLocalId</th>
			<th>inspireIdNamespace</th>
			<th>inspireIdVersionId</th>
			<th>thematicIdIdentifier</th>
			<th>beginLifespanVersion</th>
			<th>endLifespanVersion</th>
			<th>predecessorsIdentifier</th>		
			<th>successorsIdentifier</th>
			<th>wiseEvolutionType</th>
			<th>nameTextInternational</th>	
			<th>nameText</th>
			<th>nameLanguage</th>
			<th>designationPeriodBegin</th>
			<th>designationPeriodEnd</th>
			<th>zoneType</th>
			<th>legalBasisName</th>
			<th>legalBasisLink</th>
			<th>legalBasisLevel</th>
			<th>relatedZoneTransboundaryIdentifier</th>
			<th>sizeValue</th>
			<th>sizeUom</th>
			<th>link</th>
		</tr>
	</xsl:template>
 	<xsl:template name="tokenizeString">
        <xsl:param name="list"/>
        <xsl:param name="delimiter"/>
        <xsl:param name="scheme"/>
        <xsl:choose>
            <xsl:when test="contains($list, $delimiter)">                
  				<a target="_blank" href="{concat('https://dd.eionet.europa.eu/vocabularyconcept/wise/SpatialUnit/', $scheme, '.', substring-before($list,$delimiter))}"><xsl:value-of select="$scheme"/>.<xsl:value-of select="substring-before($list,$delimiter)"/></a>
			    <br/>                 
                <xsl:call-template name="tokenizeString">
                    <xsl:with-param name="list" select="substring-after($list,$delimiter)"/>
                    <xsl:with-param name="delimiter" select="$delimiter"/>
                    <xsl:with-param name="scheme" select="$scheme"/>
                </xsl:call-template>
            </xsl:when>
            <xsl:otherwise>
                <xsl:choose>
                    <xsl:when test="$list = ''">
                        <xsl:text/>
                    </xsl:when>
                    <xsl:otherwise>
						<a target="_blank" href="{concat('https://dd.eionet.europa.eu/vocabularyconcept/wise/SpatialUnit/', $scheme, '.', $list)}"><xsl:value-of select="$scheme"/>.<xsl:value-of select="$list"/></a> 			     
                    </xsl:otherwise>
                </xsl:choose>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:template>	  	
</xsl:stylesheet>