The moose likes XML and Related Technologies and the fly likes specify root for xsd validation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "specify root for xsd validation" Watch "specify root for xsd validation" New topic

specify root for xsd validation

Jan Nowakowski

Joined: Jun 07, 2010
Posts: 1
I have a xsd file which allows multiple elements to be the root element of a correct xml, i.e.

Is it possible to validate an xml file against this schema but also tell the validator that the root of the xml file should be "a" but not "b" ?
Something like

so that an xml like:

would fail the validation but

would pass
I agree. Here's the link:
subject: specify root for xsd validation
It's not a secret anymore!