xml schema, positive float

rgbcof
rgbcof used Ask the Experts™
on
How to define a positive float for an attribute?

Is this right?
    <xs:attribute name="ave_value" type="xs:float" use="required" >
      <xs:simpleType>
          <xs:restriction base="xs:float">
           <xs:minExclusive value="0.0"></xs:minExclusive>
        </xs:restriction>
      </xs:simpleType>      
    </xs:attribute>
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Information Architect
Top Expert 2006
Commented:
that is correct if you consider 0.0 not to be positive
Gertone (Geert Bormans)Information Architect
Top Expert 2006
Commented:
but you have to remove the @type on the attribute element
you should not (and I don't think you can)
have both an @type and type content to a attribute declaration

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial