c# XML Schema validation

前端 未结 1 2029
难免孤独
难免孤独 2021-01-18 22:49

I have a nice XML file like this:

    
    
                 


        
1条回答
  •  失恋的感觉
    2021-01-18 23:46

    You need to set default namespace in your xml, like this:

    
        
            
                Boomerang - Error codes.xlsx
                Boomerang - Error codes
                This is the Boomerang error codes file
                
                    Excel
                    Boomerang
                
                
                    1
                    4
                
            
            
                Issue Tracker v5.xlsx
                This is the issue tracker for Skipstone
                
                    Excel
                    Skipstone
                
                
                    1
                    4
                
            
        
    

    Also, there is a number of other problems:

    Path attribute is not defined in schema, 'Assetd' element is not defined. maxOccurs="unbounded" need to be set in schema for xs:element name="Asset"

    In case if you cannot modify xml, you need to remove target schema from xsd:

    
    

    And register schema like this:

    settings.Schemas.Add(null, "data.xsd");
    

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