Reading over the XML Schema specification, I can't see an easy way to mark an attribute as being constant (e.g. in <foo bar="baz" />
the bar
attribute must always be baz
). The only method I have come up with so far is to use an enumeration with only one element. Is this the preferred method?
<xs:attribute name="bar" type="xs:string" fixed="baz"/>
will make the attribute to have the value baz as constant.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With