XSD: What is the difference between xs:integer and xs:int?

后端 未结 3 2109
囚心锁ツ
囚心锁ツ 2020-12-14 13:51

I have started to create XSD and found in couple of examples for xs:integer and xs:int.

What is the difference between xs:integer

3条回答
  •  难免孤独
    2020-12-14 14:25

    I would just add a note of pedantry that may be important to some people: it's not correct to say that xs:int "is" a signed 32-bit integer. That form of words implies an implementation in memory (or registers, etc) within a binary digital computer. XML is character-based and would implement the maximum 32-bit signed value as "2147483647" (my quotes, of course), which is a lot more than 32 bits! What IS true is that xs:int is (indirectly) a restriction of xs:integer which sets the maximum and minimum allowed values to be the same as the corresponding implementation-imposed limits of a 32-bit integer with a sign bit.

提交回复
热议问题