Online XSD Validator and Generator

Features:

  • XML Validator: It checks XML conforms to the definition described by a XML Schema
  • XML to XSD: It generates an XSD from an XML file.
  • XSD to XML: It generates a sample XML from an XML schema.

Fill in the editors below and it will automatically check if your XML conforms to XSD.

If you want use the XML to XSD converter or the XSD to XML converter, please fill in only the desired editor and click the appropriate conversion button.

You can see the user guide to help you to use this online XSD tool. It is a beta version. Do not hesitate to report a bug or give feedback.


XML



Options for XSD from XML
XML SCHEMA



Options for XML from XSD





User guide

  • Validate XML from XSD:

    It is very simple to validate your xml with an XSD validation Online:

    Step 1: You must fill "XML" editor. You can Drag and drop a XML file, click on "Browse a XML file" or directly type in the editor.

    Step 2: It is analogous to step 1 (except that it concerns the "XML Schema" editor).

    Step 3: As soon as the editors are filled, the tool checks if the XML conforms to the XSD. If errors are detected then they are displayed below the editors, else a success message is displayed.

    XSD user guide

  • Generate XML from XSD:

    Step 1: You must fill "XML Schema" editor. You can Drag and drop a XML file, click on "Browse XML schema file" or directly type in the editor.

    Step 2: You can choose options: Click "Options for XML from XSD" to display the options.
    Root Element: If your XSD document contains more than one element, you can choose which one you want to generate an XML example.
    Choice: For choice complexType, you can specify whether you want to generate only the first element or all elements (in this case, your XML will not conform to your XSD).

    Step 3: Click on "XSD to XML".


  • Generate XSD from XML:

    Step 1: You must fill "XML" editor. You can Drag and drop a XML file, click on "Browse XML file" or directly type in the editor.

    Step 2: You can choose options: Click "Options for XSD from XML" to display the options.
    Scope: If you select "global", the components (elements and types) will be added to the global scope, they will be schema children. Otherwise, the components will be nested within another component.

    Step 3: Click on "XML to XSD".


Online XSD tools

This Online XML Schema Validator tool allows you to validate that your XML conforms to the specified schema.

If your document is not valid, the errors will be displayed, you will be able to make the necessary corrections.

This utility also allows you to generate XML examples from XSD. An XML example often makes it easier to understand the XML schema, because it is rarely very readable.

You can also generate XSD from an XML. This saves time and allows you to have a good basis.

All treatments are done locally directly in the browser, your documents are not sent to our server.

This tool uses xml.js library. It is an Emscripten port of libxml2's xmllint command.


What is XML Schema?

The XML Schema definition language (XSD) allows to define the structure and data types for XML documents. It contains a set of rules to which an XML document must conform in order to be valid. It is the current standard schema language, it is a recommendation of the World Wide Web Consortium (W3C). It is an alternative to Document type definition (DTD).

XSD defines:

  • The elements that can appear in a document
  • The attributes that can appear in a element
  • The child elements
  • The order of child elements
  • The data types for elements and attributes
  • The fixed values for elements and attributes

XML Schema can be used by developers to check XML document, for example to verify a SOAP response. If the XML document does not conform to the XML schema, the SOAP response is wrong.

XML Schema can be complicated to understand and use for a novice (especially for a non-developer), the spec is very long. The XML schema generators from xml can help to create a Schema XML.

XML Schema uses XML syntax, a XSD is a XML document! This avoids having to use another format. XSD Example

<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="book">
  <xs:complexType>
    <xs:sequence>
      <xs:element name="author" type="xs:string"/>
      <xs:element name="title" type="xs:string"/>
      <xs:element name="price" type="xs:float"/>
    </xs:sequence>
  </xs:complexType>
</xs:element>
</xs:schema>
XML Example conforms to the XML Schema
<book>
	<author>Isaac Asimov</author>
	<title>I, Robot</title>
	<price>10</price>
</book>

XSD supports several primitive data types: boolean, string, decimal, float, double, date, dateTime, base64Binary, ... Then, it is possible to create complex types.




You can report a bug or give feedback by adding a comment (below) or by clicking "Contact me" link (at the top right hand corner of the page).

Comments





Disclaimer: The tools are provided "as is", without warranty of any kind, either express or implied.
Any links to third-party website or software available on this website are provided "as is",
without warranty of any kind, either express or implied and are to be used at your own risk.