Skip to Content
ToDiagram

XML

Open XML documents and XSD schemas as a diagram, and link several XSD files into one.

Paste XML or open a .xml or .xsd file. Every element becomes a node, and its attributes and simple child elements become rows.

Example

<catalog>
  <book id="bk101">
    <author>Gambardella, Matthew</author>
    <title>XML Developer's Guide</title>
    <price>44.95</price>
  </book>
  <book id="bk102">
    <author>Ralls, Kim</author>
    <title>Midnight Rain</title>
    <price>5.95</price>
  </book>
</catalog>
The XML above as a diagram: a catalog node linked to two book nodes with their id, author, title and price
The same XML as a diagram.

Open an XML example in the editor

How XML is drawn

  • An attribute is shown as a row whose name starts with $, so id="bk101" reads $id: bk101.
  • Elements that repeat, such as the two book elements above, become a list.
  • Numbers, true and false are read by type.

XSD linking

A schema is often split over several .xsd files that refer to each other's types. Link the files and the main one shows a single diagram, with the references between files drawn as edges.

  1. Open each .xsd file in its own tab.
  2. Click the tab of the main schema, so it is the active tab.
  3. Right-click another XSD tab and choose Link to followed by the name of the main tab.

Linked tabs get the same color. To undo it, right-click the tab again and choose Unlink from.

Example

company.xsd (main)

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="Company">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="name" type="xs:string"/>
        <xs:element name="founded" type="xs:date"/>
        <xs:element name="department" type="Department"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>

  <xs:complexType name="Department">
    <xs:sequence>
      <xs:element name="name" type="xs:string"/>
      <xs:element name="budget" type="xs:decimal"/>
      <xs:element name="lead" type="Employee"/>
    </xs:sequence>
  </xs:complexType>
</xs:schema>

employees.xsd (linked)

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:complexType name="Employee">
    <xs:sequence>
      <xs:element name="employeeId" type="xs:string"/>
      <xs:element name="name" type="xs:string"/>
      <xs:element name="role" type="xs:string"/>
      <xs:element name="address" type="Address"/>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="Address">
    <xs:sequence>
      <xs:element name="street" type="xs:string"/>
      <xs:element name="city" type="xs:string"/>
      <xs:element name="zip" type="xs:string"/>
    </xs:sequence>
  </xs:complexType>
</xs:schema>

With employees.xsd linked, the diagram of company.xsd also shows Employee and Address, and the reference from Department to Employee is drawn as an edge.

On this page