本文介绍了XSD maxOccurs=“无界"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用 xsd.exe/out
它所做的是为某些元素创建了 maxOccurs="unbounded"
属性.
What its done is created maxOccurs="unbounded"
properties for certain elements.
如果我只希望元素出现一次,而不是一个集合,我应该像这样设置 maxOccurs 吗?
If I only want the element to appear once, and not be a collection do I set the maxOccurs like this?
maxOccurs="1"
推荐答案
是的.当然,请记住 maxOccurs 实际上是最大出现次数 - 仍然可以为零.如果您希望始终有一个,则还需要 minOccurs="1".
Yes. Of course, keep in mind that maxOccurs is really maximum occurances - there can still be zero. If you want there to always be one, you'll need minOccurs="1" as well.
这篇关于XSD maxOccurs=“无界"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!