<?xml-stylesheet type="text/xsl" href="sch_html.xsl"?>
<schema xmlns="http://purl.oclc.org/dsdl/schematron"
 schemaVersion="2014-03-06">
<title>Requirements by WMO Core Metadata Profile v1.3</title>
<ns prefix="gmd" uri="http://www.isotc211.org/2005/gmd"/>
<ns prefix="gco" uri="http://www.isotc211.org/2005/gco"/>
<ns prefix="gmx" uri="http://www.isotc211.org/2005/gmx"/>
<ns prefix="gml" uri="http://www.opengis.net/gml/3.2"/>
<ns prefix="xlink" uri="http://www.w3.org/1999/xlink"/>

<include href="iso19139.sch#iso19139rules" />
<include href="wcmp13.sch#wcmpbase" />

<pattern id="wcmpguide" xml:id="wcmpguide">
  <rule context="gmd:MD_Metadata">
    <assert
    flag="N-guideline"
    id="WCMPGuide.resourceFormat"
    fpi="tag:cbs-ipet-mdrd@wmo.int,2013-10-08:wcmp.resourceFormat"
    test="not(gmd:identificationInfo/*/gmd:resourceFormat)
    or gmd:distributionInfo/*/gmd:distributionFormat"
    >resourceFormat found - preferred place is distributionInfo/*/distributionFormat.</assert>
    <assert
    flag="N-guideline"
    id="WCMPGuide.geographicIdentifier"
    fpi="tag:cbs-ipet-mdrd@wmo.int,2013-10-08:wcmp.geographicIdentifier"
    test="not(gmd:identificationInfo/*/gmd:extent/*/gmd:geographicElement/*/gmd:geographicIdentifier) or gmd:identificationInfo/*/gmd:descriptiveKeywords/*/gmd:type[@code='place']"
    >geographicIdentifier found - preferred place is MD_Keyword[type='place'].</assert>
  </rule>
  <rule context="gmd:distributionFormat">
    <assert
    flag="N-guideline"
    id="WCMPGuide.formatDistributor"
    fpi="tag:cbs-ipet-mdrd@wmo.int,2013-10-08:wcmp.formatDistributor"
    test="not(*/gmd:formatDistributor)"
    >MD_Format/formatDistributor found - preferred place is distributionInfo/*/distributor.</assert>
  </rule>
  <rule context="gmd:distributor">
    <assert
    flag="N-guideline"
    id="WCMPGuide.distributorFormat"
    fpi="tag:cbs-ipet-mdrd@wmo.int,2013-10-08:wcmp.distributorFormat"
    test="not(*/gmd:distributorFormat)"
    >distributorFormat found - preferred place is distributionInfo/*/distributionFormat.</assert>
  </rule>
  <rule context="gmd:distributionInfo">
    <assert
    flag="N-guideline"
    id="WCMPGuide.transferOptions"
    fpi="tag:cbs-ipet-mdrd@wmo.int,2013-10-08:wcmp.transferOptions"
    test="not(*/gmd:transferOptions)"
    >transferOptions found - preferred place is distributor/*/distributorTransferOptions.</assert>
  </rule>
  <rule context="gmd:CI_Citation">
    <assert
    flag="N-guideline"
    id="WCMPGuide.authorityloop"
    fpi="tag:cbs-ipet-mdrd@wmo.int,2013-04-19:wcmp.authorityloop"
    test="not(gmd:identifier/*/gmd:authority)"
    >it is not preferred to describe MD_Identifier.authority in CI_Citation.identifier.  That will cause too much bloating.</assert>
  </rule>
  <rule context="*[@codeListValue]">
    <assert
    flag="N-guideline"
    id="WCMPGuide.codelistvalue"
    fpi="tag:cbs-ipet-mdrd@wmo.int,2013-04-19:wcmp.codelistvalue"
    test="@codeListValue = text()"
    >it is suggested (as the most interoperable style) to have text content (now &quot;<value-of select="text()"/>&quot;) same as @codeListValue (&quot;<value-of select="@codeListValue"/>&quot;).</assert>
  </rule>
</pattern>
</schema>
