How to exclude an enumeration value in XML file using XSD?

后端 未结 3 1056
遥遥无期
遥遥无期 2021-01-20 18:58

Is it possible to specify the value of a tag or attribute should not be like some_value ?

I have a strange requirement, where the xsd isn\'t

3条回答
  •  一整个雨季
    2021-01-20 19:46

    I don't know if you can specifically exclude a value. I'm not sure if this helps, but you can create two separate enumerations and then create the union of the enumerations.

    
      
        
        
        
        
      
    
    
    
      
        
      
    
    
    
      
    
    

    You would use either IncludedEnumType or CombinedEnumType as necessary. Using the IncludedEnumType would obviously excluded the values in ExcludedEnumType.

    This approach uses Solution 2 from this article by IBM.

提交回复
热议问题