Wednesday, January 30, 2013

Creating XSD from XML document using JDeveloper 11g

JDeveloper 11g gives you the ability to quickly and easily create an XML schema document (XSD) from an XML document.   Below are the steps needed.

1) In JDeveloper, go to File -> New
2) In the New Gallery window be sure the All Technologies tab is select.  Scroll down and select the XML category and then select XML Schema from XML Document.

3) A Create XML Schema from XML Document window will come up.  In this window you will need to fill in information on the schema file you want to create and you will need to select the XML file you want to use to generate the XSD.

Here is some additional information from the help menu on options on the Create XML Schema from XML Document page.

XML Schema
Enter a name for the new file. By default, the filename that JDeveloper creates for new files appears. The extension .XSD is displayed.

Enter a directory for the file. By default, the directory that JDeveloper creates to store your files appears. To store the files outside of JDeveloper's directory structure, or to redefine what the file directory is called, enter your changes.

Target Namespace
Enter a URI reference of the namespace of this schema.

Enter an identifier for a namespace. For example, you don't need to specify an entire namespage in an XML document when referring to its types. You can instread use the the prefix.

XML Document
Choose the XML file to use to generate the schema.

Generate Enumerations
Select to use all current values in the XML data set as enumerated values for each element/attribute in the generated XML schema.

No comments:

Post a Comment