I was fooling around a few days ago, writing an Xml Schema for an XML configuration file for a personal project I'm working on, and ran into something I don't know how to describe in XSD.... well, actually I'm not even sure it is entirely possible.
Basically, I wanted to have a section of the file contain something like this:
some string
some other string
The problem was that as I wanted it to be, the condition element could conain either the from
element, the to
element, or both, but at least one of the had to be present.
So, obviously, I know how to use minOccurs
and maxOccurs
, but that would only allow me to specify the frst condition, but not make it so that at least one of them was present. Neither did I find a way to do it using xsd:choose
and friends.
So, is it possible to do, and if so, how? I'd appreciate any tips you could offer (and a pointer to the XSD spec section that makes it possible, if you're able to provide one)!