加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

XML xs:int十六进制值

发布时间:2020-12-16 07:46:48 所属栏目:百科 来源:网络整理
导读:我想将数字存储在类型为或其他简单整数类型的 XML文件中,但允许用户以十六进制格式输入数字. XML标准是否允许这样做,因为我找不到任何相关的东西? 例如,如果XSD说: xs:element name="value" type="xs:integer" use="required" / 那么我希望XML能够说: val
我想将数字存储在类型为或其他简单整数类型的 XML文件中,但允许用户以十六进制格式输入数字. XML标准是否允许这样做,因为我找不到任何相关的东西?

例如,如果XSD说:

<xs:element name="value" type="xs:integer" use="required" />

那么我希望XML能够说:

<value>0xFF00FF</value>

或者十六进制的符号.

显然我可以尝试但只能证明在一个特定的实现中支持,而不是它是否是标准.我不特别在意保存到XML是否会失去基础.

我不这么认为. xs:integer是xs:decimal的派生/子集类型,其表示形式为 defined as

decimal has a lexical representation consisting of a finite-length sequence of decimal digits (#x30-#x39) separated by a period as a decimal indicator. An optional leading sign is allowed. If the sign is omitted,“+” is assumed. Leading and trailing zeroes are optional. If the fractional part is zero,the period and following zero(es) can be omitted. For example: -1.23,12678967.543233,+100000.00,210.

您可以删除0x并将其设置为hexBinary,尽管您丢失了语义数字.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读