XSD Viewer
Search…
Render an XSD as an image
About rendering a XSD as an image.

1 Add the XSD file as attachment to Confluence

Open the edit mode of Confluence page where you want to render the XSD image. Click on files and images and locate the XSD schema on your computer and upload it to your Confluence page.
You don’t have to attach the same XSD file for every page where you want to use the macro. Once your XSD file is attached, the plugin can search through spaces and pages for your attachment.

2 Macro

Edit the Confluence page where you want to use the plugin. Start typing {xsd. Two options of the XSD-Viewer plugin will show up:
  1. 1.
    XSD image
  2. 2.
    XSD table
Select (1) XSD image to render an image.

3 Macro panel

Once you’ve selected XSD image, the macro panel/browser will show up giving you configuration fields.
  1. 1.
    Page
  2. 2.
    Attachment
  3. 3.
    Starting element
  4. 4.
    Depth
  5. 5.
    Types to exclude

3.1 Page

This field has a built in search functionality. By typing the page where you’ve stored the attachment, even outside of the current space, you can select this page.

3.2 Attachment

A dropdown of all the attachments with the .xsd extension on this page will be shown. If no attachments with the .xsd extension are found the dropdown will mention this to you.
Note: The Atlassian OnDemand version does not yet support the attachment field type, this means that you have to manually enter the xsd filename as a string value. When this is fixed, it will be implemented! It is not possible to link to XSD files hosted elsewhere.

3.3 Starting element

Starting element is searched in the following order:
  • Element
  • SimpleType
  • ComplexType
Setting the starting element on setAttachmentResponse with depth 0 and no exclusions.

3.4 Depth

With the depth field you can configure how deep the image should be rendered. The depth configuration is applicable on element types, how far element types of element types should be rendered. The default setting is 1. For rendering the entire structure you can set the depth at 0. Please be aware that if the image to be rendered is too big the XSD-Viewer plugin might not be able to show the image. When recursiveness occurs in the chosen XSD schema we strongly suggest not to render the image at infinite depth. More about recursiveness can be found under recursiveness.
The image below is an XSD rendered with a depth limitation set at 2. The two borders drawn indicate the depth.

3.5 Types to exclude

In this input field you can configure element types you don’t want to see rendered. The element itself will still be rendered, otherwise the rendered image would be incorrect. This is handy to use when you want to render certain parts only. Some examples are given below.
The image below has a configured exclusion type. Compared to the full rendered image, you can see that the element itself is still drawn but the type no longer.
This gives you the advantage of going more into detail when wanting to render certain parts of your XSD schema as you can see in the example below.

4 Example XSD Schema

1
<xs:schema id="XMLSchema1"
2
targetNamespace="http://tempuri.org/XMLSchema1.xsd"
3
elementFormDefault="qualified"
4
xmlns="http://tempuri.org/XMLSchema1.xsd"
5
xmlns:xs="http://www.w3.org/2001/XMLSchema"
6
>
7
8
<xs:complexType name="error">
9
<xs:sequence>
10
<xs:element name="code" type="xs:int"/>
11
<xs:element name="description" type="xs:string" minOccurs="0"/>
12
</xs:sequence>
13
</xs:complexType>
14
15
<xs:complexType name="reference">
16
<xs:all>
17
<xs:element name="number" type="xs:string" minOccurs="0"/>
18
<xs:element name="description" type="xs:string" minOccurs="0"/>
19
</xs:all>
20
</xs:complexType>
21
22
<xs:complexType name="errors">
23
<xs:sequence>
24
<xs:element name="error" type="error" maxOccurs="10"/>
25
</xs:sequence>
26
</xs:complexType>
27
28
<xs:complexType name="messageAnswer">
29
<xs:sequence>
30
<xs:element name="indicationError" type="xs:boolean"/>
31
<xs:element name="errors" type="errors" minOccurs="0" maxOccurs="1">
32
<xs:annotation>
33
<xs:documentation>If the message contains errors</xs:documentation>
34
</xs:annotation>
35
</xs:element>
36
<xs:element name="reference" type="reference"/>
37
</xs:sequence>
38
</xs:complexType>
39
40
<xs:complexType name="acknowledgement">
41
<xs:sequence>
42
<xs:element name="messageAnswer" type="messageAnswer">
43
<xs:annotation>
44
<xs:documentation>The answer being given</xs:documentation>
45
</xs:annotation>
46
</xs:element>
47
</xs:sequence>
48
</xs:complexType>
49
50
<xs:element name="setAttachmentResponse" type="acknowledgement"/>
51
52
</xs:schema>
Copied!