0
<Questions xmlns="http://asdf.asdf">
  <Languages defaultLanguage="en">
    <Language name="de"/>
    <Language name="en"/>
  </Languages>
  <Question id="1">
    <Text lang="en">Are you human?</Text>
  </Question>
  <Question id="2">
    <Text lang="en">Do you have five fingers?</Text>
    <Text lang="de">Hast du fünf Finger?</Text>
  </Question>
 </Questions>

It should be validated by XML-Schema that each "Question" has a "Text" entry for the languages defined in "Languages". With keyref the Text.lang attribute can be validated to be of the defined language name.

In the above example the validation should fail because question 1 lacks the "Text" element with the attribute lang="de".

rherzog
  • 51
  • 9
  • @kjhughes The associated question doesn't answer my question. I want to enforce that each question has translation for ALL of the defined languages. The key-keyref check to only allow defined languages is already in place. – rherzog May 15 '20 at 11:44
  • To ensure that every `Language` has some property, use XSD 1.1 assertions (`every`/`satisfies`) as shown in added duplicate link. – kjhughes May 15 '20 at 13:51

0 Answers0