Understanding schematron validation

given the target node:

<iwxxm:weather xlink:href="http://codes.wmo.int/49-2/AerodromePresentOrForecastWeather/_RA"/>

and the assertion test:

@xlink:href = document('codes.wmo.int-49-2-AerodromePresentOrForecastWeather.rdf')/rdf:RDF/*/skos:member/*/@*[local-name()='about'] or @nilReason

it compares the value of iwxxm:weather/@xlink:href and document('codes.wmo.int-49-2-AerodromePresentOrForecastWeather.rdf')/rdf:RDF/*/skos:member/*/@*[local-name()='about'], since this is an assertion, it returns true if the compared values do not match OR iwxxm:weather does not have an attribute @nilReason.

It will pass if iwxxm:weather/@xlink:href and document('codes.wmo.int-49-2-AerodromePresentOrForecastWeather.rdf')/rdf:RDF/*/skos:member/*/@*[local-name()='about'] is an equal match or iwxxm:weather should have an attribute @nilReason.


The Schematron assertion is verifying that one of the following two conditions are met:

  1. the xlink:href attribute value of the iwxxm:weather context element is equal to that of the about attribute from a particular RDF document:

    • The document() function is used to access an external XML document. In this case, it is the codes.wmo.int-49-2-AerodromePresentOrForecastWeather.rdf RDF document.
    • Then it applies an XPath to select the attribute that has a local-name of about (doesn't matter if it is bound to a namespace or not)
    • that is attached to an element (doesn't matter what the name of the element is)
    • that is the child of a skos:member element
    • that is the child of an element (doesn't matter what the name of the element is)
    • that is the child of the rdf:RDF document element.

For instance, if the RDF document looked like this:

  <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
           xmlns:skos="http://www.w3.org/2004/02/skos/core#">
  <foo>
    <skos:member>
      <bar skos:about="http://codes.wmo.int/49-2/AerodromePresentOrForecastWeather/_RA"/>
    </skos:member>
  </foo>
</rdf:RDF>
  1. or the iwxxm:weather context element has a nilReason attribute

For instance, if the element were to look like this:

<iwxxm:weather nilReason="true" />