Jump to content

XML Schema editors

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Simon sprott (talk | contribs) at 10:29, 24 December 2008 (Page Creation). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

Introduction

The W3C's XML Schema Standard[1] defines a formal mechanism for describing XML documents. The standard has become very popular and is used by the majority of standards bodies when describing there data.

The standard is very versatile allowing for programming concepts such as inheritance, and type creation, however its high complexity is one of its main issues. The standard itself is approximately 400 pages long, and is written formally making it difficult to understand without committing large amounts of time to it

XML Schema Editor Tools

The problems users face when working with the XSD standard can largely be mitigated with the use of graphical editing tools. Although any text based editor can be used to edit an XML Schema, a graphical one offers the biggest advantages, allowing the structure of the document to be viewed and edited.

The editors that have been developed so far take 2 approaches to the presentation of information:-

Physical View

A physical view of an XML Schema displays a graphical entity for each element within the XML Schema. This can make an XSD document easier to read, but does little to simplify editing. This is largely down to the structure of the XSD Standard, container elements are required which are dependant on the base type used and the types contained within. Meaning small changes to the logical structure can cause changes to ripple through the document. The structure of the XSD standard also means entities are referenced from other locations with the document, some editors allow these to be expanded and viewed in the location they are referenced from some don't, meaning lots of manual cross referencing.

Logical View

A logical view shows the structure of the XML Schema without showing all the detail of the syntax used to describe it. This provides a much clear view of the XML Schema, making it easier to understand the structure of the document, and make it easier to edit. Because the editor shows the logical structure of the XSD document, there is no need to show every element, removing much of the complexity and allowing the editor to automatically managing the syntactical rules.

Example

The following example will show the source XSD, logical and physical views for a simple schema.

<?xml version="1.0" encoding="utf-8" ?>
<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:complexType name="NameType">
    <xs:sequence>
      <xs:element name="Forename" type="xs:string" />
      <xs:element name="Surname" type="xs:string" />
    </xs:sequence>
  </xs:complexType>
  <xs:element name="Person">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="Name">
          <xs:complexType>
            <xs:complexContent mixed="false">
              <xs:extension base="NameType">
                <xs:attribute name="ID" type="xs:string" />
              </xs:extension>
            </xs:complexContent>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>
Physical View Logical View
A graphical representation of the schema code above A graphical representation of the schema code above

A Sample XML Document for the schema

<?xml version="1.0" encoding="utf-8" ?>
<Person>
    <Name ID="123456">
        <Forename>John</Forename>
        <Surname>Doe</Surname>
    </Name>
</Person>

As you can see the Logical view provides more information, but without the syntactical clutter, making it easier to understand and work with.

XML Schema Editors

As the XSD standard has gained support, a host of XML Schema editors have been developed.

Application Name Screenshot Code Editor Physical Editor Logical Editor Split Code/Diagram View
Liquid XML Studio - Free Community Edition screenshots
Oxygen xml screenshots
(read only)
Stylus Studio screenshots
(read only)
XML Fox - Freeware Edition screenshots
XML Spy screenshots


References