View stylesheet

XML schema http://water.eionet.europa.eu/schemas/dir200060ec/GroundWaterMonitoringStations.xsd
Output type RDF
Description RDF
XSL file GWMonitoring-rdf.xsl (Last modified: 01 Apr 2011 13:24 )
<?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:dct="http://purl.org/dc/terms/"
    xmlns:gwm="http://wise.jrc.cec.eu.int"
    xmlns="http://rdfdata.eionet.europa.eu/wise/ontology/"
    version="1.0">

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

<!--
     $Id: GWMonitoring-rdf.xsl 9507 2011-04-01 11:22:54Z roug $
-->

<xsl:template match="gwm:GROUNDWATERMONITORINGSTATIONS">
<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:contributor><xsl:value-of select="@GeneratedBy"/></dct:contributor>
  <!--
 <dct:creator><xsl:value-of select="@Email"/></dct:creator>
 <dct:creator><xsl:value-of select="@MD_ClassificationCode"/></dct:creator>
 -->
     <xsl:apply-templates select="gwm:C_CD" mode="predicates"/>
     <xsl:apply-templates select="gwm:DIST_CD" mode="predicates"/>
     <xsl:apply-templates select="gwm:NAME" mode="predicates"/>
     <xsl:apply-templates select="gwm:REPORTING_LEVEL" mode="predicates"/>
     <xsl:apply-templates select="gwm:ASSOC_DOC_REF" mode="predicates"/>
     <xsl:apply-templates select="gwm:URL" mode="predicates"/>
 </rdf:Description>
     <xsl:apply-templates select="gwm:GROUNDWATERMONITORINGSTATION" mode="resource"/>
</rdf:RDF>
</xsl:template>


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

<xsl:template match="gwm: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="gwm:EU_CD" mode="predicates">
 <forStation>
  <xsl:attribute name="rdf:resource">http://rdfdata.eionet.europa.eu/wise/gwmstations/<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="/gwm:GROUNDWATERMONITORINGSTATIONS/gwm:DIST_CD"/></xsl:attribute>
 </forRBD>
 <xsl:element name="{local-name()}">
  <xsl:value-of select="."/>
 </xsl:element>
</xsl:template>

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

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

<xsl:template match="gwm:PROGRAMME|gwm:PARAMETER|gwm:ASSOC_WB" 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/ontology/<xsl:value-of select="local-name()"/></xsl:attribute></rdf:type>
   <xsl:apply-templates mode="predicates"/>
 </xsl:element>
</xsl:template>

<xsl:template match="gwm: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="gwm:WB_CD|gwm: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="gwm: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>

<!-- decimal elements -->
<xsl:template match="gwm:LON|gwm:LAT" mode="predicates">
 <xsl:element name="{local-name()}">
  <xsl:attribute name="rdf:datatype">http://www.w3.org/2001/XMLSchema#decimal</xsl:attribute>
  <xsl:value-of select="."/>
 </xsl:element>
</xsl:template>

<!-- boolean elements -->
<xsl:template match="gwm:QUANTITATIVE|gwm:CHEM_SURVEIL|gwm:CHEM_OPERAT|gwm:DRINK_WATER|gwm:IND_SUPPLY|gwm:ADDITIONAL_REQS|gwm:IRRIGATION|gwm:OTHER_SUPPLY" mode="predicates">
 <xsl:element name="{local-name()}">
  <xsl:attribute name="rdf:datatype">http://www.w3.org/2001/XMLSchema#boolean</xsl:attribute>
  <xsl:if test=". = 'Y'">true</xsl:if>
  <xsl:if test=". = 'N'">false</xsl:if>
 </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="*" mode="ignore"/>

</xsl:stylesheet>