Restrict complexType with attributes in XSD?

前端 未结 1 1743
日久生厌
日久生厌 2020-12-21 17:27

I\'m working with an XSD such as:




        
1条回答
  •  暖寄归人
    2020-12-21 17:37

    In order to have an attribute on an element with restricted content, define a new xs:simpleType and then use xs:extension to extend it with an attribute:

    
    
    
      
        
          
            
          
        
      
    
      
        
          
            
          
        
      
    
      
        
          
         
       
    
      
        
          
          
        
      
    
    
    

    Note also that I've simplified your regex pattern in the first case and used minInclusive/maxInclusive to more naturally express your integer range in the second case.

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