Is it possible to restrict elements to a max occur in a “choice” block?

前端 未结 4 941
野的像风
野的像风 2021-01-19 12:49

I need to solve the following problem.

//pseudo algorithm

  • you have four elements: elm1, elm2, elm3, elm4
  • elm1 occurs 0-2 times
  • elm2 o
4条回答
  •  终归单人心
    2021-01-19 13:15

    You can allways use the minOccurs and maxOccurs attributes in a XSD-schema. This will allow you to set the number of elements which are allowed in a specific element. More info in this tutorial

    An example of how this is used in a choice-block is represented here, like this:

    
       
          
             
                
                
                
             
          
       
    
    

提交回复
热议问题