XSD: default integer value range

前端 未结 1 1535
被撕碎了的回忆
被撕碎了的回忆 2021-02-20 12:20

Is there an implied default value range when defining an element of a specific data type in an XSD file? For example if I define an element of type integer:

<         


        
1条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-20 12:30

    Well, it depends on the data type...

    If you look at the definition of integer at w3:

    The value space of integer is the infinite set {...,-2,-1,0,1,2,...}

    In essence it means that, for integers, by default there is no min/max value range since any integer can be represented.

    On the other hand, for an int:

    (...) maxInclusive to be 2147483647 and minInclusive to be -2147483648.

    The list goes on for longs, shorts, etc...

    You can read it in more detail here: http://www.w3.org/TR/xmlschema-2/#typesystem

    0 讨论(0)
提交回复
热议问题