I want to check if a field has a type in my XML positive double/decimal. There is a data type in XSD type="xs:positiveInteger", but not a positive double or decimal. Is there a way to achieve this, either by defining a custom data type, or in some other way?
positive double/decimal
type="xs:positiveInteger"
<xs:element name="data"> <xs:simpleType> <xs:restriction base="xs:float"> <xs:minInclusive value="0"/> </xs:restriction> </xs:simpleType> </xs:element>
I think this should do it. Maybe a shorter way I'm still learning xsd.
You can achieve this by specifying a decimal data type with a restriction, as follows.
<xs:simpleType name="positiveDecimal"> <xs:restriction base="xs:decimal"> <xs:minInclusive value="0"/> </xs:restriction> </xs:simpleType>
Source: https://habr.com/ru/post/1767832/More articles:How to speed up data extraction from Mysql database - c #sample code for implementing rtmp in android - androidOpen iphone iphone application from my application, with drop on coordinate - iphoneOracle decoding function result with various formats - oracleHow to configure kannel gateway to receive messages from a mobile phone? - kannelIs it mandatory to instantiate collection fields in JPA? - hibernateValidating input values for special characters - javascriptSort custom C # lists - sortingToggle hidden attribute to highlight syntax in VIM - vimEntity structure inheritance - entity-frameworkAll Articles