views:

21

answers:

1

I have a Range element like

<Range min="-5.0" max="5.0" />

which is described in an XML schema as the type RangeType

<complexType name="RangeType">
    <attribute name="min" use="required" type="double" />
    <attribute name="max" use="required" type="double" />
</complexType>

Is it possible to use XML-Schema to require the max attribute to be greater than the min attribute?

+1  A: 

No. You cannot specify cross-element (edit: or cross-attribute) constraints in XML Schema.

You will have to write code or use something like Schematron.

xcut
OK, I was afraid that it was like that. Thank you.
mstahlberg