Custom validation message

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Custom validation message

amacar
This post was updated on .
Hi,
I am trying to add custom validation message for our purpose. Metadata need to have one dateTypeCode of type "creation".

I tried changing schematron-rules-iso.sch using below code (M31 is my custom error/report value), but looks like to me that I can't get attribute codeListValue and count values.
Can I get some help?


<sch:pattern>
  <sch:title>$loc/strings/M31</sch:title>
  <sch:rule context="//gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:date[gmd:CI_Date/gmd:dateType/gmd:CI_DateTypeCode/@codeListValue='creation']">
    <sch:let name="count" value="count(*)"/>
    <sch:assert test="$count = 0">
      <sch:value-of select="$loc/strings/alert.M31"/>
    </sch:assert>
    <sch:report test="$count > 0">
      <sch:value-of select="$loc/strings/report.M31"/>
    </sch:report>
  </sch:rule>
</sch:pattern>
Loading...