Link to home
Start Free TrialLog in
Avatar of brdrok
brdrok

asked on

Restrictions on attribute values

Hi,

XML and XSD newbie here.  Is it possible to restrict the values of an attribute?  Below is my try #1 but it doesn't work.

......
......
<xs:attribute name="intHour" type="xs:int" use="required" >
                <xs:simpleType>
                  <xs:restriction base="xs:integer">
                        <xs:minInclusive value="0"/>
                        <xs:maxInclusive value="23"/>
                  </xs:restriction>
            </xs:simpleType>
    </xs:attribute>
  </xs:complexType>

how can I make intHour only accept values from 0 to 23?

Many thanks...

ASKER CERTIFIED SOLUTION
Avatar of Gertone (Geert Bormans)
Gertone (Geert Bormans)
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of brdrok
brdrok

ASKER

Awesome,

always great to have another pair of eyes looking at stuff =)

Thanks