Element cannot have character [children], because the type's content type is element-only

后端 未结 2 1456
孤独总比滥情好
孤独总比滥情好 2021-01-04 13:17

I tried validating my XML file with a XSD file but I get the following error message:

[Error]: cvc-complex-type.2.3: Element \'paragraph\' cannot ha

2条回答
  •  礼貌的吻别
    2021-01-04 13:40

    This is precisely the purpose of mixed content:

        
          
    

    And:

        
          
    

    Note that you also probably want paragraph and definition to be in a xs:choice macOccurs="unbounded" given your XML.

    Here's your XSD updated with all changes needed so that your XML will be valid:

    
    
      
        
          
            
              
                
                  
                    
                      
                        
                        
                      
                    
                  
                  
                  
                  
                    
                      
                        
                        
                        
                      
                    
                  
                
              
            
            
              
                
                  
                
              
            
          
        
      
    
    

提交回复
热议问题