View stylesheet

XML schema http://water.eionet.europa.eu/schemas/dir200060ec/GWB_3p0.xsd
Output type RDF
Description RDF
XSL file GWB3p0-rdf.xsl (Last modified: 18 Jul 2012 16:56 )
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
    xmlns:dcterms="http://purl.org/dc/terms/"
    xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
    xmlns="http://rdfdata.eionet.europa.eu/wise/ontology/"
    xmlns:wf="http://water.eionet.europa.eu/schemas/dir200060ec"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    exclude-result-prefixes="wf" version="1.0">

  <xsl:output method="xml" omit-xml-declaration="no" encoding="UTF-8"/>

<!--
   Intended for http://water.eionet.europa.eu/schemas/dir200060ec/GWB_3p0.xsd
   $Id: GWB3p0-rdf.xsl 12322 2012-07-18 14:54:50Z roug $
  -->

  <xsl:template match="wf:GroundWaterBodies">
    <rdf:RDF>
      <rdf:Description rdf:about="">
        <dcterms:title><xsl:value-of select="@Description"/></dcterms:title>
        <dcterms:created><xsl:value-of select="@CreationDate"/></dcterms:created>
        <dcterms:creator><xsl:value-of select="@Creator"/></dcterms:creator>
        <forRBD>
          <xsl:attribute name="rdf:resource">http://rdfdata.eionet.europa.eu/wise/rbd/<xsl:value-of select="wf:EURBDCode"/></xsl:attribute>
        </forRBD>
        <forCountry>
          <xsl:attribute name="rdf:resource">http://rdfdata.eionet.europa.eu/ramon/nuts/<xsl:value-of select="wf:C_CD"/></xsl:attribute>
        </forCountry>
        <xsl:apply-templates mode="predicates"/>
      </rdf:Description>
      <xsl:apply-templates select="wf:GroundWaterBody"/>
    </rdf:RDF>
  </xsl:template>

  <xsl:template match="wf:GroundWaterBody">
    <GroundWaterBodyDeclaration>
      <xsl:attribute name="rdf:ID">
        <xsl:value-of select="generate-id()"/>
      </xsl:attribute>
      <xsl:apply-templates mode="predicates"/>
    </GroundWaterBodyDeclaration>
  </xsl:template>

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

<!-- Anonymous resources -->
  <xsl:template match="wf:HydrogeologicalCharacteristics|wf:PressuresAndImpacts|wf:StatusProtectedAreas|wf:QuantitativeStatus|wf:ChemicalStatus|wf:SignificantUpwardTrends|wf:ChemicalExemption" mode="predicates">
    <xsl:element name="{local-name()}">
      <xsl:attribute name="rdf:parseType">Resource</xsl:attribute>
      <xsl:apply-templates mode="predicates"/>
    </xsl:element>
  </xsl:template>

<!-- Remove redundant wrapper element -->
  <xsl:template match="wf:GroundwaterBodyStatus|wf:GWProtectedAreaDetails|wf:ChemicalExemptions" mode="predicates">
      <xsl:apply-templates mode="predicates"/>
  </xsl:template>

<!-- Completely ignore some elements when in predicates mode -->
  <xsl:template match="wf:GroundWaterBody" mode="predicates"/>

<!-- Declare the double datatype -->
  <xsl:template match="wf:AREA" mode="predicates">
    <xsl:element name="{local-name()}">
      <xsl:attribute name="rdf:datatype">http://www.w3.org/2001/XMLSchema#double</xsl:attribute>
      <xsl:value-of select="."/>
    </xsl:element>
  </xsl:template>

<!-- Latitude -->
  <xsl:template match="wf:LAT" mode="predicates">
    <xsl:element name="geo:lat">
      <xsl:attribute name="rdf:datatype">http://www.w3.org/2001/XMLSchema#double</xsl:attribute>
      <xsl:value-of select="."/>
    </xsl:element>
    <xsl:element name="rdf:type">
      <xsl:attribute name="rdf:resource">http://www.w3.org/2003/01/geo/wgs84_pos#SpatialThing</xsl:attribute>
    </xsl:element>
  </xsl:template>

<!-- Longitude -->
  <xsl:template match="wf:LON" mode="predicates">
    <xsl:element name="geo:long">
      <xsl:attribute name="rdf:datatype">http://www.w3.org/2001/XMLSchema#double</xsl:attribute>
      <xsl:value-of select="."/>
    </xsl:element>
  </xsl:template>

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

  <xsl:template match="text()" mode="predicates"/>

</xsl:stylesheet>