pulsa ⌘K para cambiar de herramienta
FORMAT & CONVERT

Generador XML → XSD

Genera definiciones de esquema XSD desde XML.

local
xml-xsd

A best-effort schema inferred from one sample. Types default to xs:string.

§01 ACERCA DE ESTA HERRAMIENTA

Overview

Paste an XML document and get a starting-point XSD (XML Schema Definition). The generator walks the element tree, creates one xs:complexType per element name, lists child elements in an xs:sequence, declares attributes as xs:string, and marks children that repeat under the same parent with maxOccurs="unbounded". Useful when you inherit an XML feed with no schema and need validation or code generation to start somewhere.

How to use

  1. Paste your document into the XML area.
  2. Read the generated schema from the XSD (inferred) output — it regenerates on every keystroke.
  3. If the input is malformed, an Invalid XML error is shown instead.

Examples

  • <books><book id="1"><title>A</title></book></books> produces a schema with booksType and bookType complex types, a title element typed xs:string, and an id attribute declared as xs:string.

Notes

Elements sharing a tag name are assumed to share one type, and namespaces are not analyzed. Treat the output as scaffolding: tighten data types, occurrence constraints, and enumerations against your real contract.

FAQ
Is my XML sent to a server?
No. The document is parsed with your browser's built-in DOMParser and the schema is generated locally. Nothing is uploaded, so proprietary payloads are safe to paste.
How accurate is the inferred schema?
It is a best-effort structure inferred from one sample: element and attribute names are captured, repeated child elements get maxOccurs="unbounded", but all leaf and attribute types default to xs:string. Refine types and constraints by hand.
Can the generated XSD detect optional elements?
No. With a single sample there is no way to tell required from optional, so every observed element appears in the sequence. Add minOccurs="0" yourself where elements may be absent.