XML Schema for sequence of elements with same name but different attribute values?

前端 未结 5 1832
南笙
南笙 2021-01-18 00:37

How can I specify an XML schema for an instance document like this:


  
  

        
5条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-18 01:16

    You could try something like this - create a separate complexType for your "informationSet" elements, and limit the attribute to a list of valid strings:

    
      
        
          
            
          
        
      
    
      
        
          
            
          
        
      
    
      
        
          
          
        
      
    
    

    Of course, you can extend that list of valid attribute names if you wish - just add more elements to the restriction-enumeration list there.

    Marc

提交回复
热议问题