我必须为以下
创建架构 <Root>
<users>
<user1>
<element1/>
<element2/>
</user1>
<user2>
<element1/>
<element2/>
</user2>
</users>
</Root>
元素user和user1是动态的,xml中可以有n个用户,其他元素保持不变。
有人可以帮助我为此创建架构吗?
答案 0 :(得分:1)
使users
元素包含任意数量的user
元素。不要试图通过为每个用户元素指定不同的名称来使它们成为唯一的。就像在你最喜欢的编程语言中一样,你在一个整数数组中存储500个整数的集合,而不是在500个整数变量中存储,这些变量名为int001,int002,int003,... int500。
使用该技术,而不是反对它。