Middle way between XSD all and XSD sequence

后端 未结 7 1916
故里飘歌
故里飘歌 2020-11-30 05:03

I\'m defining a user element with XSD. For this example, a user has a name, email and one or more nationalities. I\'ve tried:


  

        
7条回答
  •  北海茫月
    2020-11-30 05:21

    For XSD 1.0 the suggestion from leppie works.

    The XSD

    
    
      
        
          
            
            
            
              
            
          
        
      
    
    

    A sample XML document that validates against the schema

    
      Name
      name@name.com
      Italian
      Japanese
      Alien
    
    

    And validation e.g. using xmllint

    xmllint --noout --schema test.xsd test.xml
    test.xml validate
    

提交回复
热议问题