<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: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:am="http://inspire.ec.europa.eu/schemas/am/4.0" 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/am/4.0/AreaManagementRestrictionRegulationZone.xsd                                 http://inspire.ec.europa.eu/schemas/gn/4.0 http://inspire.ec.europa.eu/schemas/gn/4.0/GeographicalNames.xsd" gml:id="cpegeo"><gml:featureMembers><xsl:for-each select="/ogr:FeatureCollection/ogr:featureMember/node()"><xsl:if test="ogr:RsCaSeHyPE=2"><am:ManagementRestrictionOrRegulationZone><xsl:attribute name="gml:id"><xsl:value-of select="@gml:id"/></xsl:attribute><am:inspireId><base:Identifier><base:localId><xsl:value-of select="ogr:CdSegHydOr"/>7</base:localId><base:namespace>http://id.eaufrance.fr/cpe/</base:namespace></base:Identifier></am:inspireId><am:name><gn:GeographicalName><gn:language>fr</gn:language><gn:nativeness nilReason="unknown" xsi:nil="true"/><gn:nameStatus nilReason="unknown" xsi:nil="true"/><gn:sourceOfName nilReason="unknown" xsi:nil="true"/><gn:pronunciation nilReason="unknown" xsi:nil="true"/><gn:spelling><gn:SpellingOfName><gn:text><xsl:value-of select="ogr:NoSegHyd"/></gn:text><gn:script nilReason="unknown" xsi:nil="true"/></gn:SpellingOfName></gn:spelling></gn:GeographicalName></am:name><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"/>
                            <!--                                    
                                <base2:LegislationCitation gml:id="LegislationCitation_UK0005_1">
                                        <base2:name>2011/850/EC</base2:name>
                                        <base2:shortName>AQ IPR for e-Reporting</base2:shortName>
                                        <base2:date>

                                        </base2:date>
                                        <base2:link>http://rod.eionet.europa.eu/instruments/650</base2:link>
                                        <base2:identificationNumber>2011/850/EC</base2:identificationNumber>
                                        <base2:officialDocumentNumber>OJ L 335, 17.12.2011, p. 86–106</base2:officialDocumentNumber>
                                        <base2:dateEnteredIntoForce>2014-01-01</base2:dateEnteredIntoForce>
                                        <base2:level xlink:href="http://inspire.ec.europa.eu/codeList/LegislationLevelValue/european"/>
                                    </base2:LegislationCitation>
                                </am:legalBasis>
                            --><xsl:if test="ogr:StSegHyd=Gelé"><am:endLifespanVersion><xsl:value-of select="ogr:DtMaSegHyd"/></am:endLifespanVersion></xsl:if></am:ManagementRestrictionOrRegulationZone></xsl:if></xsl:for-each></gml:featureMembers></gml:FeatureCollection></xsl:template></xsl:stylesheet>