I am stuck with an xsd definition problem. Please help to provide a solution –
I have two element structure possible –
<Books>
<Book>Effective java</Book>
</Books>
OR
<Books>
<Book>
<Name>Effective java</Name>
<Author>Josh</Author>
</Book>
</Books>
I have tried using two different complex types to define each, but validation fails saying that we cannot have element with multiple types.
Also, I tried using union but looks like it can only work on inbuilt types.
Is this at all possible ? If yes, please help providing pointers.
Got this solution which allows the mixing of Simple and complex types –