This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hmm.....usually we use schemas are used to define the structure of your XML and validate the structure. So if you have random elements in your XML, then its debatable whether you need a schema or otherwise. That said, you can as well write a schema that does not enforce......welll.....nooo.
The more I think about this the more I am inclined to say I wouldn't bother with a schema. If I were to do this, I would get rid of the schema (if that is possible) and move that business logic into the JDOM code. Logically validate if the elements are present or otherwise.
I am interested in any other ways of doing this. Other thoughts please.