Limit number of elements with attribute via XSD?

后端 未结 1 2054
花落未央
花落未央 2021-01-25 08:39

There is a fragment of XML


    uid-1
    uid-2
    uid-3&         


        
1条回答
  •  长发绾君心
    2021-01-25 09:24

    You cannot express your constraint in XSD 1.0, but in XSD 1.1, you can use xs:assert to limit the itemUID elements with key attributes to 0, 2, 3 elements as follows:

      
    

    Here it is in context in a complete XSD:

    XSD 1.1

    
    
    
      
        
          
            
               
                 
                   
                     
                     
                   
                 
               
            
          
          
        
      
    
    

    0 讨论(0)
提交回复
热议问题