I have the following XSD schema (extract):
<xs:key name="type">
<xs:selector xpath="./datatypes/struct|./datatypes/array" />
<xs:field xpath="@type" />
</xs:key>
<xs:keyref name="typeref" refer="type">
<xs:selector xpath="./function/parameter|./function/return|./gloabalVariable|./datatypes/struct/field|./datatypes/array" />
<xs:field xpath="@typeref" />
</xs:keyref>
Explanation: I want to specify some types which I can refer in functions, variables and other types.
Now I want to refer to primitive types, which are not declared in the XML, but should be constant keys in the XSD schema to which can be referred to.
What I have tried (and does not work):
<xs:key name="type">
<xs:selector xpath="./datatypes/struct|./datatypes/array" />
<xs:field xpath="@type|'uint8'|'int32'|..." />
</xs:key>
How can I specify constant keys in XSD schemas?
What I came up with and works for me: