Liquid XML Studio
Inferring an XML Schema (XSD)
Send Feedback
XML Editor > Inferring an XML Schema (XSD)

Glossary Item Box

If your new to XML schema's or have just been given XML documents which have no underlying XSD, then it is possible to create an XML Schema that describes your data using the XSD Inferrer.

This uses one or more XML documents, and uses them to construct an XML Schema (XSD). Typically the XSD will need a little tweaking before it is exactly what you want, but it is a good starting point.

There are a number of advantages to using an XML Schema.

 

You can infer an XML Schema by opening up an XML file and selecting the "Infer XML Schema" option ()

Specify the sample XML files that will be used to infer the XSD schema.

The more sample files you have the more accurate the resulting XML Schema.

 

 

 

The second page contains options relating to the inferring process.

Schema Name

The name of the schema that will be produced (there is no need to add the .xsd extension).
If more than 1 schema file needs to be created, then the schema files will be named <Schema Name>1.xsd, <Schema Name>2.xsd etc 

Output Directory

The location where your schema file/files will be written.

Encoding

The encoding that will be applied to your XML Schema (UTF-8 or UTF-16 are the most commonly used, only change this if you understand encoding).

Occurrence Options

If the Occurrence property is set to Restricted, the first time elements are encountered in the XML document, the schema declaration is inferred as minOccurs="1".
When attributes are encountered, the schema declaration is inferred as use="required". If the Occurrence property is set to Relaxed, element schema declarations are inferred as minOccurs="0", and attribute schema declarations are inferred as use="optional".

Type Inference Option

If the TypeInference property is set to Relaxed, the inferred type of elements and attributes in the XML document with simple content is always xs:string.
If the TypeInference property is set to Restricted, more specific types are inferred, such as xs:date, xs:decimal, xs:unsignedByte, and so on.