How to generate XSD from elements of XML

前端 未结 5 1447
故里飘歌
故里飘歌 2021-02-19 23:23

I have a XML input


  id
  string
  42
  

        
5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-20 00:01

    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.

提交回复
热议问题