Are there libraries that implement the ability to generate xml on the xsd scheme?

  • What do you have in mind? How can I get XML from XSD in general? Also, strictly speaking, XSD itself is an XML document. - cy6erGn0m
  • one
    In addition, it is not clear what language is being spoken. - cy6erGn0m 8:55 pm
  • I apologize. I went to this site using the link "ask a question about Java" and therefore did not specify the language. And I mean this: since xsd describes the structure of an xml document, it is logical to assume that based on this description, you can create an xml template (with empty or default values). - BlindEagle
  • one
    And why do you need this at all? If you want to generate XML with data, you can use JAXB to generate code for this from the XSD schema. - cy6erGn0m
  • Generating an XML document using a schema can be very helpful in testing the code that parses XML. - a_gura

3 answers 3

I solved this problem with org.apache.xmlbeans.XmlOptions;

    Visual Studio has an XML schema browser that can generate a sample XML document using an XSD schema. For this you need:

    • open circuit
    • select root node
    • make a right click with the mouse
    • select create xml

    In addition, the .NET has the XmlSampleGenerator API. Read more here: Generating XML Documents from XML Schemas .

      Take a look at the xsd2inst (Schema to Instance Tool) , including their sources .

      Prints an XML instance of the specified global element using the specified schema.

      • It seems that such a program is no more ... - Pavel Mayorov