Skip to content
Test versionSearch

Developer tools

XML sample to XSD generator

Create an editable XSD draft from an own XML sample. Choose inferred or string types, ordered sequences or broader choices, and observed or repeated occurrences.

How it worksFAQRelated tools

Content reviewed:

Use an own XML example, choose settings and calculate. Native exports and report exports are separate; reloading removes temporary scenarios.

Scope: 2000 input units, 64 elements,depth 10,8 attributes per element,ASCII XML names and one element namespace or none. DTDs, processing instructions, namespaced data attributes and xsi nil/type are refused. Schema locations are ignored; nothing is fetched. Comments are not preserved. Generated rules describe the sample, not business rules or all future documents. Output 3500 units; no arbitrary XSD validation here.

Decimal results are approximate. Inputs stay in this browser tab.

How it works

Own bounded XML observations:conservative boolean, integer, decimal and real calendar-date types; leading-zero identifiers remain strings. Sequence order conflicts require explicit choice. Required fields and attributes follow observations unless optional is chosen. Scope: 2000 input units, 64 elements,depth 10,8 attributes per element,ASCII XML names and one element namespace or none. DTDs, processing instructions, namespaced data attributes and xsi nil/type are refused. Schema locations are ignored; nothing is fetched. Comments are not preserved. Generated rules describe the sample, not business rules or all future documents. Output 3500 units; no arbitrary XSD validation here.

Worked example

Own XML sample; inferred types and occurrence rules remain explicit.

Frequently asked questions

How do I generate an XSD schema from an XML file?

Paste an XML sample or load a UTF-8 XML file of up to 8 KiB, choose the type, order and occurrence settings and calculate. The XML to XSD generator creates an editable XSD draft that can be downloaded.

Which data types does the XSD generator infer?

It conservatively infers boolean, integer, decimal and real calendar-date types. Identifiers with leading zeros remain strings, and you can choose string types instead of inferred ones.

How are repeated elements and required fields handled?

Occurrences follow the sample unless you choose repeated occurrences, and required fields and attributes follow the observations unless optional is chosen. Sequence order conflicts require an explicit choice between ordered sequences and broader choices.

What are the size limits of the XML sample?

Up to 2000 input units, 64 elements, a depth of 10, 8 attributes per element, ASCII XML names and one element namespace or none. The output is limited to 3500 units.

Which XML features are not supported?

DTDs, processing instructions, namespaced data attributes and xsi nil or type are refused. Schema locations are ignored, nothing is fetched and comments are not preserved.

Will the generated XSD fit all future XML documents?

No. The generated rules describe the sample only, not business rules or all future documents, so broader requirements need your own review. The generator does not validate arbitrary XSD.