i want to create a xml schema that allows only one single root node .
In the structure below the root node, there is an element that i want to reuse in different locations.
My first approach was to create a global element in the schema, but if i do so, a xml document having only a tag as root is also valid against this schema.
How do i create global elements that are only allowed to be used as ref-element inside my root-structure?
This is what i want to have:
<root>
<branch>
<leaf/>
</branch>
<branch>
<fork>
<branch>
<leaf/>
</branch>
</leaf>
</fork>
</root>
But this would also be valid
<leaf/>
as root node