I'm wondering if it's possible to have a schema use user-defined elements (from the XML) for its structure.
As in, as a user, I would be able to have something like:
<subjectType>
<name>plane</name>
<name>bird</name>
</subjectType>
<questionType>
<name>organic</name>
<name>awesome</name>
</questionType>
<subjectInterview subjectType="plane">
<question questionType="organic">false</question>
<question questionType="awesome">true</question>
</subjectInterview>
<subjectInterview subjectType="bird">
<question questionType="organic">true</question>
<question questionType="awesome">false</question>
</subjectInterview>
So the schema would know about:
- subjectType
- questionType
- subjectInterview
- question
but not the user-defined sub-elements. It would understand how the elements nest in relation to each other and have other restrictions (it would treat the user-defined values like enums to prevent typos and prevent duplicate questionType's per subjectType).
How would I go about getting this type of user-defined content to be enforced in a schema?
edit: If it matters, I also plan on unmarshalling the user-defined xml to java classes.
Thanks