How to generate XSD from elements of XML

前端 未结 5 1140
野趣味
野趣味 2021-02-19 23:38

I have a XML input


  id
  string
  42
  

        
5条回答
  •  清歌不尽
    2021-02-20 00:24

    You could write an XSLT to do something like that. But the problem is, a single document alone is not enough information to generate a schema. Are any of those elements optional? Is there anything missing from that document, that might appear in other instances? How many of a particular element can there be? Do they have to be in that order? There are loads of things that can be expressed in a schema, that are not immediately obvious from one instance of a document that conforms to that schema.

提交回复
热议问题