XSD: Define an element with any name

后端 未结 1 2078
猫巷女王i
猫巷女王i 2021-02-08 23:48

Because of limitations of certain systems, we need to use XMLs that are formatted a bit inconveniently. Those we need to transform into a convenient form.

The question:

1条回答
  •  忘了有多久
    2021-02-09 00:31

    You can use the element together with the Xml Schema Instance type attribute.

    Schema

    
    
        
            
                
                    
                
            
        
        
            
        
    
    

    Test Xml instance

    
    
        
        value one
        
    
        
        value two
    
        
        
            value four
        
    
    

    Conclusion

    You cannot enforce a simple type in the xsd schema alone.

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