I have this xml-Schema:
Stadt
and Tabellenplatz
mustn't be xml elements but need to be attributes of the element Fussballmannschaft
. This pattern repeats with the inner elements.
The schema also lacks structures to express repetition of elements (namely the Spieler
element) and choices between player roles (Torwart
,Verteidiger
,Stuermer
).
The use of the xs:keyref
in the schema definition appears to be incomplete - the referenced keys are not specified as xs:key
elements. In order to demonstrate this use, a new root element Fussball
is defined, which should reflect the intent of the schema to formalize the notion of soccer teams. This new root element harbors the key and keyref definitions for the club name attribute and will be needed anyway as soon as multiple teams are to be represented in in a file (there must be a single root element in an xml file ).
The following pair of schema and sample passes the validation.
Schema:
XML:
References
key
and keyref