开发者

Specify XML schema data type of decimal or blank

开发者 https://www.devze.com 2022-12-24 05:23 出处:网络
Is there a way in an XML schema to specify that an element may contain either an empty string or a decimal?

Is there a way in an XML schema to specify that an element may contain either an empty string or a decimal?

If I specify the type as xs:deci开发者_如何学编程mal like this:

<xs:element name="Sample" type="xs:decimal" />

then a blank value would not pass validation:

<Sample/>

(I realize that the best way to indicate no value would be to not include the element, but I was wondering if there was a way to allow blank or decimal.)


Add nillable="true".

0

精彩评论

暂无评论...
验证码 换一张
取 消