Specify XML Schema Data Type Decimal or Empty

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

If I specify the type as xs:decimalfollows:

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

then an empty value will not pass the check:

<Sample/>

(I understand that the best way to specify a value would not be to not include the element, but I was wondering if there was a way to allow null or decimal.)

+3
source share
1 answer

Add nillable="true".

+4
source

Source: https://habr.com/ru/post/1738396/


All Articles