开发者

matching null with regex in xsd

I want to allow null elements in xsd. Usually I do this with the nillable="true" attribute, but it doesn't work for elements like this:

<xs:simpleType name="numbers">
<xs:restriction base="xs:integer"&开发者_运维百科gt;
<xs:pattern value="[0-9][0-9]"/>
</xs:restriction>
</xs:simpleType>

I thought, that maybe there is a way to allow null elements with regex. Or should I do it with xsd?

Can you help me?

Thanks!


So you want your valid values to be any 0-, 1-, or 2-digit number? How extensive is the support for regular expressions in the <xs:pattern/> field? Can you do something like <xs:pattern value="[0-9]{0,2}">?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜