XML Schema Tutorials - Herong's Tutorial Examples
Dr. Herong Yang, Version 4.11

Generating XML Schema Diagrams

This section describes a tutorial example on how to generate graphical diagrams representing relations of validation rules defined in XML Schema (XSD) documents using XMLPad.

Another nice feature of XMLPad is generating graphical diagrams representing relations of validation rules defined in XML Schema (XSD) documents. The following tutorial example shows you how to generate an XML schema diagram from our first XSD document, first_html.xsd.

1. Run XMLPad and click menu File > Open. Select \xsd\first_html.xsd in the "Open" dialog box. XMLPad displays the XSD document in the edit window:

<?xml version = "1.0" encoding = "utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
  elementFormDefault="qualified" attributeFormDefault="unqualified">
 <xs:element name="html" type="htmlType"/>
 <xs:complexType name="htmlType">
  <xs:sequence>
   <xs:element name="body" type="xs:string"/>
  </xs:sequence>
 </xs:complexType>
</xs:schema>

2. Click the "Diagram" button at the bottom of the editor window. XMLPad will show a simple diagram with two sections:

  • Global types - Top level datatypes that are defined in the XSD file. There is only one top level datatype, "htmlType", defined in first_html.xsd.
  • Global elements - Top level XML elements that are defined in the XSD file. There is only one top level XML element, "html", defined in first_html.xsd.

3. Click the "+" sign next to each definition, XMLPad will show you how top level definitions are related to lower level definitions.
XMLPad - Generate XML Schema Diagram

Sections in This Chapter

Installing WMHelp XMLPad Pro

Creating and Editing XML Documents

Creating and Editing XML Schema Documents

Assigning XML Schema to XML Documents

Validating XML Documents with Assigned XSD

Validating Non-Conforming XML Documents

XMLPad Crash When Validating Non-Conforming XML Documents

Generating XML Schema Diagrams

Dr. Herong Yang, updated in 2009
Generating XML Schema Diagrams