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

前端 未结 4 962
野的像风
野的像风 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条回答
  •  Happy的楠姐
    2021-01-19 13:21

    It's not possible in xml-schema. You can use a choice in combination with something like schematron:

    
    
        Occurance rules
        
            an error message
        
    
    

提交回复
热议问题