How Do I: Generate Schema from an XML Instance Document?

You can use a third-party XML authoring tool like Altova's XMLSpy to generate XML schema from an XML instance document.

This procedure describes a simple way to generate schema from an instance, but is just a beginning. As with many wizard-style conversion tools, the results of this one are a "best guess" at getting the results you want. Keep in mind the following:

To Generate Schema from an Instance Document in XMLSpy

  1. Open your XML file in XMLSpy.
  2. From the DTD/Schema menu, click Generate DTD/Schema.
  3. In the Generate DTD/Schema dialog, select the options that suit your needs. Here are suggestions:
  4. Click OK.
  5. When prompted to assign the schema to your XML document, choose:
  6. Edit the generated schema to meet your needs.

Once you have finished your schema, you can compile it to generated Java types. See How Do I: Use XML Schema in WebLogic Workshop? for more information.

Related Topics

Getting Start with XMLBeans