I'm trying to create a type in an XML schema to enforce an element with both:
- A single attribute; and
- Simple content matching an enumeration.
In an XML document, the element might look like:
<Operator Permutation="true">
Equals
</Operator>
Where "Equals" would be one of the enumerations.
Is this possible? If so, how?
I've tried doing in in XMLSpy with no success. If I make a simple type, it only allows content enumeraions without attributes. If I make a complex type, it only allows attributes without content enumerations.
Edit: Thanks, David. That works perfectly, but I just added this inside the restriction so the validation ignores line breaks:
<xs:whiteSpace value="collapse"/>