Baha'i Date Schema

The following is a Schematron schema to allow an unofficial scheme for the vaildation of Baha'i dates. The predictability of this schema could vary in the future, if a decision is made by the international governing body of the Baha'i Faith, the Universal House of Justice, as to the site for which Naw-Ruz, the new year, will be determined. At such a time, the beginning of the year will vary by one or two days, so it will not be as easy to detect the validity of dates which might change (in the first or last month, or intercalary days?). It is also certain whether the leap years will follow the current Gregorian calendar or not. Moreover, the representation of the separate intercalary days as being tagged on to the end of month 18 was simply for ease in calculation purposes.

Despite all of the above disclaimers, this should still ideally be helpful, and might offer an example of how dates or other attributes can be constrained depending on the value of multiple attributes, using Schematron.

                <let name="leap400" value='((($year - 1 + $bbe) mod 400) = 0) or ((($ayyamiha_leap - 1 + $bbe) mod 400) = 0)'/> <let name="nonleap100" value='((($year - 1 + $bbe) mod 100) = 0) or ((($ayyamiha_leap - 1 + $bbe) mod 100) = 0)'/> <let name="leap4" value='((($year - 1 + $bbe) mod 4) = 0) or ((($ayyamiha_leap - 1 + $bbe) mod 4) = 0)'/> <assert test="$leap400 or (not($nonleap100) and $leap4)">Such a date is only available in a leap year. <assert test='matches(@when, $pattern) or matches(@when, $pattern_ayyamiha)'>The date's "when" attribute is not a correct Baha'i date.