View stylesheet

XML schema http://water.eionet.europa.eu/schemas/dir200856ec/MSCA_1p0.xsd
Output type RDF
Description RDF for Content Registry
XSL file MSCA_1p0-rdf.xslt (Last modified: 23 Apr 2012 16:10 )
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:dct="http://purl.org/dc/terms/"
xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
xmlns="http://rdfdata.eionet.europa.eu/msfd/ontology/"

xmlns:fn="http://www.w3.org/2005/xpath-functions"
xmlns:ms="http://water.eionet.europa.eu/schemas/dir200856ec/mscommon"
xmlns:n1="http://water.eionet.europa.eu/schemas/dir200856ec"
xmlns:xdt="http://www.w3.org/2005/xpath-datatypes"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
exclude-result-prefixes="fn ms n1 xdt xs xsi">

<!--
  $Id: MSCA_1p0-rdf.xslt 11710 2012-04-23 14:09:36Z roug $
-->

<xsl:output method="xml" indent="yes" encoding="UTF-8"/>

<xsl:variable name="lcletters">abcdefghijklmnopqrstuvwxyz</xsl:variable>
<xsl:variable name="ucletters">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable>

<xsl:template match="n1:MSCA">
<rdf:RDF>

 <rdf:Description rdf:about="">
  <dct:created><xsl:value-of select="@CreationDate"/></dct:created>
  <dct:creator><xsl:value-of select="@Creator"/></dct:creator>
  <dct:description><xsl:value-of select="@Description"/></dct:description>
  <dct:language><xsl:value-of select="@Language"/></dct:language>
  <countryCode><xsl:value-of select="C_CD"/></countryCode>
 </rdf:Description>
 <xsl:apply-templates select="n1:CompetentAuthority" mode="resource"/>
</rdf:RDF>
</xsl:template>

<xsl:template match="n1:CompetentAuthority" mode="resource">
 <xsl:element name="{concat(local-name(),'Declaration')}">
  <xsl:attribute name="rdf:ID"><xsl:value-of select="generate-id()"/></xsl:attribute>
   <xsl:apply-templates mode="predicates"/>
 </xsl:element>
</xsl:template>

<xsl:template match="n1:MSCACode" mode="predicates">
 <xsl:element name="MSCACode"><xsl:value-of select="."/></xsl:element>
 <xsl:element name="rdfs:label"><xsl:value-of select="."/></xsl:element>
</xsl:template>

<xsl:template match="*" mode="predicates">
 <xsl:element name="{concat(translate(substring(local-name(),1,1),$ucletters,$lcletters),substring(local-name(),2))}">
  <xsl:value-of select="."/>
 </xsl:element>
</xsl:template>

<xsl:template match="*" mode="ignore"/>
</xsl:stylesheet>