The type attribute cannot be present with either simpleType or complexType

后端 未结 1 1449
故里飘歌
故里飘歌 2021-01-23 23:26

I have the below XSD & when I am trying to generate XML out of it I am getting the above error : Error!!! The type attribute cannot be present with either simple

1条回答
  •  旧巷少年郎
    2021-01-23 23:59

    If you define the type of your element inline you can't name it so remove the type="InvoiceData" attribute (and then the name="InvoiceData" attribute as well).

    If you want to use those attributes then you need to separate element and type definition e.g. and ....

    The complete schema would be either

    
      
        
          
            
              
                
                  
                  
                  
                  
                
              
            
          
        
      
    
    

    or

    
    
      
    
      
        
          
        
      
    
      
        
          
          
          
          
        
      
    
    
    

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