<xsl:stylesheet xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:php="http://php.net/xsl" xmlns:ogr="http://ogr.maptools.org/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://inspire.ec.europa.eu/schemas/am/4.0 http://inspire.ec.europa.eu/schemas/am/4.0/AreaManagementRestrictionRegulationZone.xsd" exclude-result-prefixes="xs" version="1.0"><xsl:output method="xml" indent="yes"/><xsl:template match="/"><gml:FeatureCollection xmlns="http://www.opengis.net/wfs" xmlns:ef="http://inspire.ec.europa.eu/schemas/ef/4.0" xmlns:wfs="http://www.opengis.net/wfs/2.0" xmlns:gn="http://inspire.ec.europa.eu/schemas/gn/4.0" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:p="http://xml.sandre.eaufrance.fr/scenario/quesu/3" xmlns:gco="http://www.isotc211.org/2005/gco" xmlns:base2="http://inspire.ec.europa.eu/schemas/base2/2.0" xmlns:gml1="http://www.opengis.net/gml" xmlns:base="http://inspire.ec.europa.eu/schemas/base/3.3" xsi:schemaLocation="http://www.opengis.net/gml/3.2 http://schemas.opengis.net/gml/3.2.1/gml.xsd               http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd                                                                                                                 http://inspire.ec.europa.eu/schemas/am/4.0 http://inspire.ec.europa.eu/schemas/ef/4.0/EnvironmentalMonitoringFacilities.xsd                                            http://inspire.ec.europa.eu/schemas/gn/4.0 http://inspire.ec.europa.eu/schemas/gn/4.0/GeographicalNames.xsd" gml:id="quesugeo"><gml:featureMembers>
                <!--<xsl:for-each select="/p:QUESU/p:StationMesureEauxSurface/node()">--><xsl:for-each select="./p:QUESU/p:StationMesureEauxSurface"><ef:EnvironmentalMonitoringFacility><xsl:attribute name="gml:id">QUESU.<xsl:value-of select="p:CdStationMesureEauxSurface"/></xsl:attribute><ef:inspireId><base:Identifier><base:localId>FR<xsl:value-of select="p:CdStationMesureEauxSurface"/></base:localId><base:namespace>http://id.eaufrance.fr/stq/</base:namespace></base:Identifier></ef:inspireId><ef:name><xsl:value-of select="p:NomStationMesureEauxSurface"/></ef:name><ef:mediaMonitored/><ef:onlineResource>http://id.eaufrance.fr/stq/<xsl:value-of select="p:CdStationMesureEauxSurface"/></ef:onlineResource><ef:representativePoint><gml:Point srsName="http://www.opengis.net/def/crs/EPSG/0/2154"><xsl:attribute name="gml:id">QUESU.geom.<xsl:value-of select="p:CdStationMesureEauxSurface"/></xsl:attribute><gml:coordinates><xsl:value-of select="p:CoordXStationMesureEauxSurface"/>, <xsl:value-of select="p:CoordYStationMesureEauxSurface"/></gml:coordinates></gml:Point></ef:representativePoint><ef:measurementRegime/><ef:mobile>false</ef:mobile><ef:operationalActivityPeriod/>

                        <!--
                            <am:geometry>
                                <xsl:copy-of select="ogr:geometryProperty/node()"/>
                            </am:geometry>
                            <am:zoneType xlink:href="http://id.eaufrance.fr/scn/cpegeo/1"/>
                            <am:designationPeriod>
                                <gml:TimePeriod>
                                    <xsl:attribute name="gml:id">
                                        <xsl:value-of select="concat('BT',@gml:id)"/>
                                    </xsl:attribute>
                                    <gml:beginPosition>
                                        <xsl:value-of
                                            select="php:functionString('sandre2inspire_convertDate', ogr:DtCaSeHyPE)"
                                        />
                                    </gml:beginPosition>
                                    <gml:endPosition indeterminatePosition="unknown"/>
                                </gml:TimePeriod>
                            </am:designationPeriod>
                            <am:environmentalDomain
                                xlink:href="http://inspire.ec.europa.eu/codelist/EnvironmentalDomain/water"/>
                            <am:environmentalDomain
                                xlink:href="http://inspire.ec.europa.eu/codelist/EnvironmentalDomain/naturalResources"/>
                            <am:competentAuthority>
                                <base2:RelatedParty>
                                    <base2:organisationName>
                                        <gco:CharacterString>Service d'Administration Nationale des
                                            Données et Référentiels sur l'Eau
                                            (Sandre)</gco:CharacterString>
                                    </base2:organisationName>
                                </base2:RelatedParty>
                            </am:competentAuthority>
                            <xsl:if test="ogr:DtCrSegHyd">
                                <am:beginLifespanVersion>
                                    <xsl:value-of
                                        select="php:functionString('sandre2inspire_convertDate', ogr:DtCrSegHyd)"
                                    />
                                </am:beginLifespanVersion>
                            </xsl:if>
                            <xsl:if test="not(ogr:DtCrSegHyd)">
                                <am:beginLifespanVersion xsi:nil="true" nilReason="missing"/>
                            </xsl:if>
                            <am:legalBasis xsi:nil="true" nilReason="missing"/>

                            <xsl:if test="ogr:StSegHyd=Gelé">
                                <am:endLifespanVersion>
                                    <xsl:value-of select="ogr:DtMaSegHyd"/>
                                </am:endLifespanVersion>
                            </xsl:if>
                        </am:ManagementRestrictionOrRegulationZone>
                        --></ef:EnvironmentalMonitoringFacility></xsl:for-each></gml:featureMembers></gml:FeatureCollection></xsl:template></xsl:stylesheet>