XML Online Editor


One online XML editor I found is called XmlGrid.net. It will, among other things, convert your XML file to an XSD file for you.

An XML Schema describes the structure of an XML document. The XML Schema language is also referred to as XML Schema Definition (XSD). The purpose of an XML Schema is to define the legal building blocks of an XML document:

  • the elements and attributes that can appear in a document
  • the number of (and order of) child elements
  • data types for elements and attributes
  • default and fixed values for elements and attributes

In the XML world, hundreds of standardized XML formats are in daily use. Many of these XML standards are defined by XML Schemas. XML Schema is an XML-based (and more powerful) alternative to DTD. A DTD is a Document Type Definition. A DTD defines the structure and the legal elements and attributes of an XML document. With a DTD, independent groups of people can agree on a standard DTD for interchanging data. An application can use a DTD to verify that XML data is valid.

<?xml version='1.0'?>
<BookInfo>
   <Book>
      <ISBN>989-0-487-04641-2</ISBN>
      <Title>My World</Title>
      <Author>Nancy Davolio</Author>
      <Quantity>121</Quantity>
   </Book>
   <Book>
      <ISBN>981-0-776-05541-0</ISBN>
      <Title>Get Connected</Title>
      <Author>Janet Leverling</Author>
      <Quantity>435</Quantity>
   </Book>
   <Book>
      <ISBN>999-1-543-02345-2</ISBN>
      <Title>Honesty</Title>
      <Author>Robert Fuller</Author>
      <Quantity>315</Quantity>
   </Book>
</BookInfo>

<?xml version="1.0" encoding="UTF-8"?>
   <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
         <!-- XML Schema Generated from XML Document on Wed Feb 22 2017 08:53:34 GMT-0500 (Eastern Standard Time) -->
         <!-- with XmlGrid.net Free Online Service http://xmlgrid.net -->
         <xs:element name="BookInfo">
               <xs:complexType>
                     <xs:sequence>
                           <xs:element name="Book" maxOccurs="unbounded">
                                 <xs:complexType>
                                       <xs:sequence>
                                             <xs:element name="ISBN" type="xs:string"></xs:element>
                                             <xs:element name="Title" type="xs:string"></xs:element>
                                             <xs:element name="Author" type="xs:string"></xs:element>
                                             <xs:element name="Quantity" type="xs:int"></xs:element>
                                       </xs:sequence>
                                 </xs:complexType>
                           </xs:element>
                     </xs:sequence>
               </xs:complexType>
         </xs:element>
   </xs:schema>

Microsoft XML to XSD Tool

Microsoft has a tool for this.

Series Navigation<< XML IntroductionXML Attributes vs. Elements >>

Leave a comment

Your email address will not be published. Required fields are marked *