View stylesheet

XML schema http://water.eionet.europa.eu/schemas/dir200060ec/SurfaceWaterMonitoringStations.xsd
Output type RDF
Description RDF for Content Registry
XSL file SWMonitoring-rdf.xsl (Last modified: 04 Nov 2009 12:36 )
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:swm="http://wise.jrc.cec.eu.int"
    xmlns="http://rdfdata.eionet.europa.eu/wise/wfdart8/"
    version="1.0">

<xsl:output method="xml" indent="yes" />

<!--
     $Rev: 7865 $
-->

<xsl:template match="swm:SURFACEWATERMONITORINGSTATIONS">
<rdf:RDF>

 <rdf:Description rdf:about="">
  <dc:date><xsl:value-of select="@CreationDate"/></dc:date>
  <dc:creator><xsl:value-of select="@Creator"/></dc:creator>
  <!--
 <dc:contributor><xsl:value-of select="@GeneratedBy"/></dc:contributor>
 <dc:creator><xsl:value-of select="@Email"/></dc:creator>
 <dc:creator><xsl:value-of select="@MD_ClassificationCode"/></dc:creator>
 -->
     <xsl:apply-templates select="swm:C_CD" mode="predicates"/>
     <xsl:apply-templates select="swm:DIST_CD" mode="predicates"/>
     <xsl:apply-templates select="swm:NAME" mode="predicates"/>
     <xsl:apply-templates select="swm:REPORTING_LEVEL" mode="predicates"/>
     <xsl:apply-templates select="swm:REPORTING_LEVEL_DESCRIPTION" mode="predicates"/>
     <xsl:apply-templates select="swm:ASSOC_DOC_REF" mode="predicates"/>
     <xsl:apply-templates select="swm:URL" mode="predicates"/>
 </rdf:Description>
     <xsl:apply-templates select="swm:SURFACEWATERMONITORINGSTATION" mode="resource"/>
</rdf:RDF>
</xsl:template>


<xsl:template match="swm:SURFACEWATERMONITORINGSTATION" mode="resource">
 <xsl:element name="{local-name()}">
  <xsl:attribute name="rdf:ID"><xsl:value-of select="translate(swm:EU_CD,' ','')"/></xsl:attribute>
   <inDeclaration rdf:resource=""/>
   <xsl:apply-templates mode="predicates"/>
 </xsl:element>
</xsl:template>

<xsl:template match="swm:DIST_CD" mode="predicates">
 <forRBD>
  <xsl:attribute name="rdf:resource">http://rdfdata.eionet.europa.eu/wise/rbd/<xsl:value-of select="."/></xsl:attribute>
 </forRBD>
 <xsl:element name="{local-name()}">
  <xsl:value-of select="."/>
 </xsl:element>
</xsl:template>

<xsl:template match="swm:EU_CD" mode="predicates">
 <forStation>
  <xsl:attribute name="rdf:resource">http://rdfdata.eionet.europa.eu/wise/swmstations/<xsl:value-of select="translate(.,' ','')"/></xsl:attribute>
 </forStation>
 <forRBD>
  <xsl:attribute name="rdf:resource">http://rdfdata.eionet.europa.eu/wise/rbd/<xsl:value-of select="/swm:SURFACEWATERMONITORINGSTATIONS/swm:DIST_CD"/></xsl:attribute>
 </forRBD>
 <xsl:element name="{local-name()}">
  <xsl:value-of select="."/>
 </xsl:element>
</xsl:template>

<xsl:template match="swm:INTER_NETWORKS" mode="predicates">
   <xsl:apply-templates mode="ignore"/>
</xsl:template>

<xsl:template match="swm:PROGRAMMES|swm:PARAMETERS|swm:PROT_AREAS|swm:QUALITY_ELEMENTS" mode="predicates">
   <xsl:apply-templates mode="predicates"/>
</xsl:template>

<xsl:template match="swm:PROGRAMME|swm:PARAMETER|swm:ASSOC_WB|swm:QUALITY_ELEMENT" mode="predicates">
 <xsl:element name="{local-name()}">
  <xsl:attribute name="rdf:parseType">Resource</xsl:attribute>
   <rdf:type><xsl:attribute name="rdf:resource">http://rdfdata.eionet.europa.eu/wise/wfdart8/<xsl:value-of select="local-name()"/></xsl:attribute></rdf:type>
   <xsl:apply-templates mode="predicates"/>
 </xsl:element>
</xsl:template>

<xsl:template match="swm:PROGRAMME_CD" mode="predicates">
 <forProgramme>
  <xsl:attribute name="rdf:resource">http://rdfdata.eionet.europa.eu/wise/programmes/<xsl:value-of select="."/></xsl:attribute>
 </forProgramme>
 <xsl:element name="{local-name()}">
  <xsl:value-of select="."/>
 </xsl:element>
</xsl:template>

<xsl:template match="swm:WB_CD|swm:WB_LOCATION" mode="predicates">
 <forWB>
  <xsl:attribute name="rdf:resource">http://rdfdata.eionet.europa.eu/wise/waterbodies/<xsl:value-of select="."/></xsl:attribute>
 </forWB>
 <xsl:element name="{local-name()}">
  <xsl:value-of select="."/>
 </xsl:element>
</xsl:template>

<xsl:template match="swm:PARAMETER_CD" mode="predicates">
 <forParameter>
  <xsl:attribute name="rdf:resource">http://rdfdata.eionet.europa.eu/wise/parameters/<xsl:value-of select="."/></xsl:attribute>
 </forParameter>
 <xsl:element name="{local-name()}">
  <xsl:value-of select="."/>
 </xsl:element>
</xsl:template>

<xsl:template match="swm:QE_CD" mode="predicates">
 <forQualityElement>
   <xsl:attribute name="rdf:resource">http://rdfdata.eionet.europa.eu/wise/qualityelements/<xsl:value-of select="."/></xsl:attribute>
 </forQualityElement>
 <xsl:element name="{local-name()}">
   <xsl:value-of select="."/>
 </xsl:element>
</xsl:template>

<!-- boolean elements -->
<xsl:template match="swm:SURVEIL|swm:OPERAT|swm:INTERCAL_SITE|swm:REFERENCE_SITE|swm:DRINK_WATER" mode="predicates">
 <xsl:if test=". = 'Y' or . = 'N'">
  <xsl:element name="{local-name()}">
   <xsl:if test=". = 'Y'">true</xsl:if>
   <xsl:if test=". = 'N'">false</xsl:if>
  </xsl:element>
 </xsl:if>
</xsl:template>

<xsl:template match="swm:BATHING" mode="predicates">
 <xsl:if test=". = 'Y'">
   <areaProtectedBy rdf:resource="http://rod.eionet.europa.eu/instruments/204"/>
 </xsl:if>
</xsl:template>

<xsl:template match="swm:BIRDS" mode="predicates">
 <xsl:if test=". = 'Y'">
   <areaProtectedBy rdf:resource="http://rod.eionet.europa.eu/instruments/563"/>
 </xsl:if>
</xsl:template>

<xsl:template match="swm:DRINKING" mode="predicates">
 <xsl:if test=". = 'Y'">
   <areaProtectedBy rdf:resource="http://rod.eionet.europa.eu/instruments/218"/>
 </xsl:if>
</xsl:template>

<xsl:template match="swm:FISH" mode="predicates">
 <xsl:if test=". = 'Y'">
   <areaProtectedBy rdf:resource="http://rod.eionet.europa.eu/instruments/210"/>
 </xsl:if>
</xsl:template>

<xsl:template match="swm:SHELLFISH" mode="predicates">
 <xsl:if test=". = 'Y'">
   <areaProtectedBy rdf:resource="http://rod.eionet.europa.eu/instruments/214"/>
 </xsl:if>
</xsl:template>

<xsl:template match="swm:HABITATS" mode="predicates">
 <xsl:if test=". = 'Y'">
   <areaProtectedBy rdf:resource="http://rod.eionet.europa.eu/instruments/560"/>
 </xsl:if>
</xsl:template>

<xsl:template match="swm:NITRATES" mode="predicates">
 <xsl:if test=". = 'Y'">
   <areaProtectedBy rdf:resource="http://rod.eionet.europa.eu/instruments/257"/>
 </xsl:if>
</xsl:template>

<xsl:template match="swm:UWWT" mode="predicates">
 <xsl:if test=". = 'Y'">
   <areaProtectedBy rdf:resource="http://rod.eionet.europa.eu/instruments/543"/>
 </xsl:if>
</xsl:template>

<xsl:template match="swm:ABSTRACTION" mode="predicates">
 <xsl:if test=". = 'Y'">
   <areaProtectedBy rdf:resource="http://rod.eionet.europa.eu/instruments/202"/>
 </xsl:if>
</xsl:template>

<xsl:template match="*" mode="predicates">
 <xsl:element name="{local-name()}">
  <xsl:value-of select="."/>
 </xsl:element>
</xsl:template>

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

</xsl:stylesheet>