定义 Relax NG Schema 中特定的元素数量
我想问你如何在Relax NG Schema中定义特定数量的元素。例如,我有一个关于竞赛的XML文件。这次比赛,应该只有两支队伍。不超过两队 到目前为止我所做的是
元素团队{ 元素团队 {xsd:string}+ 但
+ 总是表示一个或多个 请你帮助我好吗
I want to ask you how to define a specific number of elements in Relax NG Schema.For example, I have an XML file about a contest. In this contest, there should be only two teams. no more than two teams
what I have done so far is
element teams{
element team {xsd:string}+
}
but + always means one or more
Could you please help me
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
RelaxNG 仅支持定义、oneOrMore、zeroOrMore、可选、列表或混合。您不能定义任意数量的元素。不过,您可以列出可能包含的每个元素。为了使列表更容易,您可以从包含列表的元素创建列表,尽管这并没有更好。下面是一个五个分组的示例。
对于两个的情况,最简单的写法是
RelaxNG only supports define, oneOrMore, zeroOrMore, optional, list or mixed. You cannot define an arbitary amount of elements. You can however list each element that may be included. To make the listing easier you may create the list from elements that contains lists, though that isn't any better. Here's an example with groupings of five.
For the case of two, it is easiest to write