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

后端 未结 3 2104
囚心锁ツ
囚心锁ツ 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:07

    The difference is the following: xs:int is a signed 32-bit integer. xs:integer is an integer unbounded value. See for details https://web.archive.org/web/20151117073716/http://www.w3schools.com/schema/schema_dtypes_numeric.asp For example, XJC (Java) generates Integer for xs:int and BigInteger for xs:integer.

    The bottom line: use xs:int if you want to work cross platforms and be sure that your numbers will pass without a problem. If you want bigger numbers – use xs:long instead of xs:integer (it will be generated to Long).

提交回复
热议问题