To address this shortcoming Schematron should make the abstraction of a specific
message and its natural language content explicit. Rather than treating localized variants
as different diagnostics, they should be treated as one diagnostic with different
localized variants. A sch:message
element that wraps the
mixed-content templates would do the trick.
Figure 4. Multi-lingual schema, improved
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron"> <sch:title>Improved Example of Multi-Lingual Schema</sch:title> <sch:pattern> <sch:rule context="dog"> <sch:assert test="bone" diagnostics="bone"/> </sch:rule> </sch:pattern> <sch:diagnostics> <sch:diagnostic id="bone"> <sch:message xml:lang="en">A dog should have a bone.</sch:message> <sch:message xml:lang="de">Ein Hund sollte ein Bein haben.</sch:message> </sch:diagnostic> </sch:diagnostics> </sch:schema>