XSD - allow element type as integer OR empty

后端 未结 5 1570
挽巷
挽巷 2020-12-10 01:55

I need to be able to set a simple element type as an integer but allow it to also be empty. This example sends an error if its empty and a blank field is not an integer. H

5条回答
  •  无人及你
    2020-12-10 02:16

    What you have to do is assign restrictions on the same element plus make a union on them such as the following example:

    
      
        
          
            
              
            
          
          
            
          
        
      
    
    

    By using this restriction, you tell the xml validation to allow any integer value and allowing the element if it is empty.

提交回复
热议问题